/* =============================================
   Auth Page - Liquid Glass Design
   ============================================= */

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: transparent;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

@keyframes shimmerPulse1 {
    0%, 100% {
        opacity: 0.35;
        transform: translate(0, 0) scale(1);
    }
    33% {
        opacity: 0.55;
        transform: translate(15px, -15px) scale(1.1);
    }
    66% {
        opacity: 0.45;
        transform: translate(-10px, 10px) scale(1.05);
    }
}

@keyframes shimmerPulse2 {
    0%, 100% {
        opacity: 0.3;
        transform: translate(0, 0) scale(1);
    }
    50% {
        opacity: 0.5;
        transform: translate(-20px, -20px) scale(1.15);
    }
}

/* Liquid Glass Card */
.auth-card {
    position: relative;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.08) 0%,
        rgba(255, 255, 255, 0.03) 100%
    );
    backdrop-filter: blur(40px) saturate(150%);
    -webkit-backdrop-filter: blur(40px) saturate(150%);
    border: 1px solid var(--border-subtle);
    border-radius: 28px;
    padding: 3rem;
    width: 100%;
    max-width: 480px;
    z-index: 1;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 0 80px rgba(255, 107, 53, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    overflow: visible;
}

/* Top light reflection */
.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.25),
        transparent
    );
    border-radius: 28px 28px 0 0;
}

/* Subtle glow effect */
.auth-card::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(
        135deg,
        rgba(255, 107, 53, 0.15) 0%,
        transparent 40%,
        transparent 60%,
        rgba(255, 184, 0, 0.1) 100%
    );
    border-radius: 30px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.auth-card:hover::after {
    opacity: 1;
}

/* Tabs - Liquid Glass Style */
.auth-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    background: linear-gradient(
        135deg,
        rgba(26, 26, 26, 0.7) 0%,
        rgba(26, 26, 26, 0.4) 100%
    );
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 0.375rem;
    border-radius: 16px;
    border: 1px solid var(--border-subtle);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 4px 16px rgba(0, 0, 0, 0.2);
}

.auth-tab {
    flex: 1;
    padding: 0.875rem 1.5rem;
    background: transparent;
    border: none;
    border-radius: 12px;
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.auth-tab::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.2), rgba(255, 184, 0, 0.15));
    opacity: 0;
    transition: opacity 0.35s ease;
    border-radius: 12px;
}

.auth-tab:hover {
    color: rgba(255, 255, 255, 0.85);
}

.auth-tab:hover::before {
    opacity: 0.5;
}

.auth-tab.active {
    color: var(--color-orange);
    text-shadow: 0 0 20px rgba(255, 107, 53, 0.5);
}

.auth-tab.active::before {
    opacity: 1;
}

.auth-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--color-orange), transparent);
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(255, 107, 53, 0.6);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--color-orange), var(--color-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Form Group - Liquid Glass */
.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-group label {
    display: block;
    color: var(--color-white);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.required {
    color: var(--color-orange);
}

.form-group input {
    width: 100%;
    padding: 1rem 1.25rem;
    background: var(--bg-input);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    color: var(--color-white);
    font-size: 1.1rem;
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.3),
        0 1px 0 rgba(255, 255, 255, 0.05);
}

.form-group input:focus {
    outline: none;
    border-color: var(--color-orange);
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.3),
        0 0 0 3px rgba(255, 107, 53, 0.15),
        0 0 20px rgba(255, 107, 53, 0.1);
}

.form-group input::placeholder {
    color: var(--text-hint);
    font-family: inherit;
    letter-spacing: normal;
}

/* Token Input Group */
.token-input-group {
    position: relative;
}

.token-input-group input {
    padding-right: 4rem;
}

.token-counter {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
    font-size: 0.85rem;
    font-family: monospace;
    pointer-events: none;
}

.token-counter span {
    color: var(--color-orange);
}

/* Token Verify Input */
.token-verify-input {
    text-align: center;
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
}

/* Token Slot Display (registration) */
.token-slot-display {
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 1rem 0.75rem;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2px;
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0;
    overflow: hidden;
}

.token-char {
    display: inline-block;
    width: 1ch;
    text-align: center;
    color: var(--text-dim);
    transition: color 0.2s ease;
    position: relative;
}

.token-char.generated {
    color: var(--color-gold);
}

.token-char.rolling {
    animation: slotCharRoll 0.08s linear infinite;
}

@keyframes slotCharRoll {
    0% { transform: translateY(0); opacity: 1; }
    50% { transform: translateY(-50%); opacity: 0.5; }
    100% { transform: translateY(0); opacity: 1; }
}

/* Registration buttons: stars and "Generate and copy" on the same level, slightly closer */
.register-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
    margin-top: 1.5rem;
}

.register-buttons .btn-wrapper {
    width: 100%;
}

.register-buttons .btn {
    width: 100%;
    justify-content: center;
    align-items: center;
    gap: 0;
}

.register-buttons .btn .btn-svg {
    margin-right: 0.15rem;
}

.btn-secondary {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    border-radius: 12px;
    background: var(--bg-btn);
    border: 1px solid var(--border-btn);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-btn-hover);
    border-color: var(--border-btn-hover);
    color: #ff6b35;
}

.btn-secondary:active:not(:disabled) {
    transform: scale(0.98);
}

.btn-secondary.generating {
    opacity: 0.7;
    pointer-events: none;
}

/* Token Warning - Liquid Glass */
.token-warning {
    position: relative;
    background: linear-gradient(
        135deg,
        rgba(255, 184, 0, 0.12) 0%,
        rgba(255, 184, 0, 0.06) 100%
    );
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 184, 0, 0.4);
    border-radius: 16px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    text-align: center;
    box-shadow: none;
    overflow: hidden;
}

.token-warning::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 184, 0, 0.5), transparent);
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.warning-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 0 8px rgba(255, 184, 0, 0.5));
}

.warning-text {
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.warning-text strong {
    color: var(--color-gold);
    text-shadow: 0 0 10px rgba(255, 184, 0, 0.4);
}

/* Copy Success */
.copy-success {
    text-align: center;
    color: #4ade80;
    font-size: 0.9rem;
    margin-top: -0.5rem;
    margin-bottom: 1rem;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Success Message */
.success-message {
    background: rgba(74, 222, 128, 0.15);
    border: 1px solid rgba(74, 222, 128, 0.5);
    color: #4ade80;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    text-align: center;
    animation: fadeIn 0.3s ease;
}

/* Verify Instruction */
.verify-instruction {
    text-align: center;
    margin-bottom: 1.5rem;
}

.verify-instruction p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Auth Step */
.auth-step {
    animation: fadeIn 0.3s ease;
}

/* Auth Section */
.auth-section {
    display: none;
    opacity: 0;
    animation: fadeIn 0.3s ease;
    transition: opacity 0.3s ease;
}

.auth-section.active {
    display: block;
    opacity: 1;
}

/* Back Link */
.back-link {
    display: block;
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-muted);
}

.back-link:hover {
    color: var(--color-orange);
}

/* Button Auth - Liquid Glass Primary */
.btn-auth {
    width: 100%;
    margin-top: 1rem;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    border-radius: 12px;
    background: var(--bg-btn);
    border: 1px solid var(--border-btn);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    animation: none;
    box-shadow: none;
    transform: none;
}

.btn-auth:hover:not(:disabled) {
    background: var(--bg-btn-hover);
    border-color: var(--border-btn-hover);
    color: #ff6b35;
    transform: none;
    box-shadow: none;
}

.btn-auth:active:not(:disabled) {
    transform: scale(0.98);
}

.btn-auth:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* Error Message */
.error-message {
    background: rgba(255, 107, 53, 0.15);
    border: 1px solid rgba(255, 107, 53, 0.5);
    color: var(--color-orange);
    padding: 0.75rem 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    text-align: center;
}

/* Auth Switch */
.auth-switch {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-subtle);
    color: var(--text-muted);
    font-size: 0.95rem;
}

.link-button {
    background: none;
    border: none;
    color: var(--color-orange);
    cursor: pointer;
    text-decoration: none;
    font-size: inherit;
    margin-left: 0.5rem;
    transition: var(--transition);
    font-weight: 500;
}

.link-button:hover {
    color: var(--color-gold);
    text-decoration: underline;
}

/* Token Slot Animation */
.token-slot {
    display: inline-block;
    overflow: hidden;
    height: 1.2em;
    vertical-align: middle;
}

.token-slot-inner {
    animation: slotRoll 0.5s ease-out forwards;
}

@keyframes slotRoll {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(0); }
}

/* Responsive for MacBook 13" and medium screens (1280-1600px) */
@media (min-width: 1280px) and (max-width: 1600px) {
    .auth-container {
        padding: 40px;
    }
    
    .auth-card {
        max-width: 520px;
        padding: 3.5rem;
        border-radius: 32px;
        box-shadow: 
            0 10px 40px rgba(0, 0, 0, 0.45),
            0 0 100px rgba(255, 107, 53, 0.1),
            inset 0 1px 0 rgba(255, 255, 255, 0.12);
    }
    
    .auth-tabs {
        border-radius: 18px;
        padding: 0.4rem;
    }
    
    .auth-tab {
        border-radius: 14px;
        padding: 1rem 1.5rem;
    }
    
    .auth-header {
        margin-bottom: 2.5rem;
    }
    
    .auth-header h1 {
        font-size: 2.25rem;
    }
    
    .auth-header p {
        font-size: 1.05rem;
    }
    
    .form-group {
        margin-bottom: 1.75rem;
    }
    
    .form-group input {
        padding: 1.125rem 1.375rem;
        font-size: 1.1rem;
        border-radius: 16px;
    }
    
    .token-slot-display {
        font-size: 1.15rem;
        padding: 1.125rem 0.875rem;
        border-radius: 16px;
    }
    
    .btn-auth {
        margin-top: 1.5rem;
        padding: 1.125rem 2.5rem;
        font-size: 1.1rem;
        border-radius: 16px;
    }
    
    .btn {
        padding: 1rem 1.5rem;
        border-radius: 16px;
        min-height: 56px;
    }
    
    .btn-secondary {
        padding: 1.125rem 2rem;
        font-size: 1.05rem;
        border-radius: 16px;
    }
    
    .token-warning {
        padding: 1.5rem;
        border-radius: 18px;
    }
    
    .warning-icon {
        font-size: 2.25rem;
    }
    
    .warning-text {
        font-size: 1rem;
    }
}

/* Responsive for large screens (1601px+) */
@media (min-width: 1601px) {
    .auth-container {
        padding: 60px;
    }
    
    .auth-card {
        max-width: 580px;
        padding: 4rem;
        border-radius: 36px;
        box-shadow: 
            0 12px 50px rgba(0, 0, 0, 0.5),
            0 0 120px rgba(255, 107, 53, 0.12),
            inset 0 1px 0 rgba(255, 255, 255, 0.15);
    }
    
    .auth-tabs {
        border-radius: 20px;
        padding: 0.5rem;
    }
    
    .auth-tab {
        border-radius: 16px;
        padding: 1.125rem 1.75rem;
        font-size: 1.1rem;
    }
    
    .auth-header {
        margin-bottom: 3rem;
    }
    
    .auth-header h1 {
        font-size: 2.75rem;
    }
    
    .auth-header p {
        font-size: 1.15rem;
    }
    
    .form-group {
        margin-bottom: 2rem;
    }
    
    .form-group input {
        padding: 1.25rem 1.5rem;
        font-size: 1.15rem;
        border-radius: 18px;
    }
    
    .token-slot-display {
        font-size: 1.3rem;
        padding: 1.25rem 1rem;
        border-radius: 18px;
    }
    
    .btn-auth {
        margin-top: 2rem;
        padding: 1.25rem 3rem;
        font-size: 1.2rem;
        border-radius: 18px;
    }
    
    .btn {
        padding: 1.125rem 1.75rem;
        border-radius: 18px;
        min-height: 60px;
        font-size: 1.1rem;
    }
    
    .btn-svg {
        height: 24px;
        width: 24px;
        margin-right: 0.2rem;
    }
    
    .register-buttons .btn .btn-svg {
        margin-right: 0.2rem;
    }
    
    .btn-secondary {
        padding: 1.25rem 2.25rem;
        font-size: 1.1rem;
        border-radius: 18px;
    }
    
    .token-warning {
        padding: 1.75rem;
        border-radius: 20px;
    }
    
    .warning-icon {
        font-size: 2.5rem;
    }
    
    .warning-text {
        font-size: 1.05rem;
    }
}

/* Responsive for mobile */
@media (max-width: 480px) {
    .auth-container {
        padding: 16px;
    }
    
    .auth-card {
        padding: 1.75rem 1.25rem;
        border-radius: 20px;
        max-width: 100%;
    }

    .auth-tabs {
        margin-bottom: 1.5rem;
        padding: 0.25rem;
        border-radius: 12px;
        gap: 0.25rem;
    }

    .auth-tab {
        padding: 0.75rem 0.75rem;
        font-size: 0.9rem;
    }

    .auth-header {
        margin-bottom: 1.5rem;
    }
    
    .auth-header h1 {
        font-size: 1.6rem;
    }
    
    .auth-header p {
        font-size: 0.9rem;
    }

    .form-group input {
        padding: 0.875rem 1rem;
        font-size: 1rem;
        border-radius: 12px;
    }

    .token-slot-display {
        font-size: 0.85rem;
        padding: 0.875rem 0.5rem;
    }

    .token-char {
        width: 0.85ch;
    }

    .btn-auth {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
        border-radius: 12px;
    }

    .btn-secondary {
        font-size: 0.9rem;
        padding: 0.875rem 1rem;
    }
    
    .token-warning {
        padding: 1rem;
        border-radius: 12px;
    }
    
    .warning-icon {
        font-size: 1.75rem;
    }
    
    .warning-text {
        font-size: 0.85rem;
    }
    
    .register-buttons {
        gap: 0.875rem;
    }
    
    .btn-svg {
        margin-right: 0.75rem;
    }
    
    .register-buttons .btn .btn-svg {
        margin-right: 0.75rem;
    }
}

/* Very small screens */
@media (max-width: 360px) {
    .auth-card {
        padding: 1.5rem 1rem;
    }
    
    .auth-header h1 {
        font-size: 1.4rem;
    }
    
    .auth-tab {
        padding: 0.625rem 0.5rem;
        font-size: 0.85rem;
    }
}

/* Tablet responsive (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    .auth-container {
        padding: 24px;
    }
    
    .auth-card {
        max-width: 450px;
        padding: 2.5rem 2rem;
        border-radius: 24px;
    }
    
    .auth-tabs {
        margin-bottom: 1.75rem;
    }
    
    .auth-header h1 {
        font-size: 1.9rem;
    }
    
    .form-group input {
        padding: 1rem 1.125rem;
    }
    
    .btn-auth {
        padding: 0.95rem 1.75rem;
        font-size: 1.05rem;
    }
    
    .btn {
        min-height: 50px;
    }
}

/* Small desktop / large tablet (769px - 1279px) */
@media (min-width: 769px) and (max-width: 1279px) {
    .auth-container {
        padding: 32px;
    }
    
    .auth-card {
        max-width: 500px;
        padding: 3rem 2.5rem;
        border-radius: 26px;
    }
    
    .auth-header h1 {
        font-size: 2.1rem;
    }
    
    .auth-header p {
        font-size: 1rem;
    }
    
    .form-group input {
        padding: 1.05rem 1.25rem;
        font-size: 1.05rem;
    }
    
    .btn-auth {
        padding: 1.05rem 2rem;
        font-size: 1.1rem;
    }
    
    .btn {
        min-height: 54px;
        padding: 0.95rem 1.35rem;
    }
}

/* Old styles for compatibility */
.toggle-password {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.25rem;
    transition: opacity 0.3s ease, visibility 0.3s ease, color 0.3s ease, transform 0.3s ease;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.toggle-password.visible {
    opacity: 1;
    visibility: visible;
}

.toggle-password:hover {
    color: var(--color-orange);
}

.form-group.has-label .toggle-password {
    top: calc(50% + 1.25rem);
}

/* =============================================
   Animated Generate Button Styles - Liquid Glass
   ============================================= */

.btn-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.btn {
    --transition: 0.2s;

    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 1.5rem;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    background: var(--bg-btn);
    border: 1px solid var(--border-btn);
    border-radius: 12px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition) ease;
    position: relative;
    outline: none;
    overflow: hidden;
    min-height: 52px;
    white-space: nowrap;
}

.btn-letter {
    position: relative;
    display: inline-block;
    color: rgba(255, 255, 255, 0.5);
    animation: letter-anim 2s ease-in-out infinite;
    transition: color var(--transition), text-shadow var(--transition), opacity var(--transition);
}

@keyframes letter-anim {
    0%, 100% {
        color: rgba(255, 255, 255, 0.5);
        text-shadow: none;
    }
    50% {
        text-shadow: 0 0 8px rgba(255, 107, 53, 0.6);
        color: rgba(255, 255, 255, 0.8);
    }
}

.btn-svg {
    flex-shrink: 0;
    height: 22px;
    width: 22px;
    margin-right: 0.15rem;
    fill: none;
    stroke: var(--color-orange);
    stroke-width: 1.5;
    animation: sparkle 2s ease-in-out infinite;
    filter: drop-shadow(0 0 4px rgba(255, 107, 53, 0.5));
    transition: all var(--transition);
    display: block;
    vertical-align: middle;
}

@keyframes sparkle {
    0%, 100% {
        filter: drop-shadow(0 0 4px rgba(255, 107, 53, 0.5));
        transform: scale(1);
    }
    50% {
        filter: drop-shadow(0 0 10px rgba(255, 107, 53, 0.8));
        transform: scale(1.05);
    }
}

.txt-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 8em;
    min-height: 1.35em;
    line-height: 1.35;
    white-space: nowrap;
}

.txt-1,
.txt-2 {
    position: absolute;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: inherit;
}

.txt-1 {
    animation: appear-anim 1s ease-in-out forwards;
}

.txt-2 {
    opacity: 0;
}

@keyframes appear-anim {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

.btn:focus .txt-1 {
    animation: opacity-anim 0.3s ease-in-out forwards;
    animation-delay: 1s;
}

.btn:focus .txt-2 {
    animation: opacity-anim 0.3s ease-in-out reverse forwards;
    animation-delay: 1s;
}

@keyframes opacity-anim {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

.btn:focus .btn-letter {
    animation: focused-letter-anim 1s ease-in-out forwards, letter-anim 1.2s ease-in-out infinite;
    animation-delay: 0s, 1s;
}

@keyframes focused-letter-anim {
    0%, 100% {
        filter: blur(0px);
        color: rgba(255, 255, 255, 0.5);
    }
    50% {
        transform: scale(1.2);
        filter: blur(3px) brightness(150%);
        color: var(--color-orange);
    }
}

.btn:focus .btn-svg {
    filter: drop-shadow(0 0 12px rgba(255, 107, 53, 0.9));
}

.btn:focus::before {
    opacity: 1;
}

.btn:focus::after {
    left: 100%;
}

/* Animation delays for .btn-letter elements */
.btn-letter:nth-child(1),
.btn:focus .btn-letter:nth-child(1) {
    animation-delay: 0s;
}
.btn-letter:nth-child(2),
.btn:focus .btn-letter:nth-child(2) {
    animation-delay: 0.08s;
}
.btn-letter:nth-child(3),
.btn:focus .btn-letter:nth-child(3) {
    animation-delay: 0.16s;
}
.btn-letter:nth-child(4),
.btn:focus .btn-letter:nth-child(4) {
    animation-delay: 0.24s;
}
.btn-letter:nth-child(5),
.btn:focus .btn-letter:nth-child(5) {
    animation-delay: 0.32s;
}
.btn-letter:nth-child(6),
.btn:focus .btn-letter:nth-child(6) {
    animation-delay: 0.4s;
}
.btn-letter:nth-child(7),
.btn:focus .btn-letter:nth-child(7) {
    animation-delay: 0.48s;
}
.btn-letter:nth-child(8),
.btn:focus .btn-letter:nth-child(8) {
    animation-delay: 0.56s;
}
.btn-letter:nth-child(9),
.btn:focus .btn-letter:nth-child(9) {
    animation-delay: 0.64s;
}
.btn-letter:nth-child(10),
.btn:focus .btn-letter:nth-child(10) {
    animation-delay: 0.72s;
}
.btn-letter:nth-child(11),
.btn:focus .btn-letter:nth-child(11) {
    animation-delay: 0.8s;
}
.btn-letter:nth-child(12),
.btn:focus .btn-letter:nth-child(12) {
    animation-delay: 0.88s;
}
.btn-letter:nth-child(13),
.btn:focus .btn-letter:nth-child(13) {
    animation-delay: 0.96s;
}

/* Active state */
.btn:active {
    transform: scale(0.98);
    border-color: var(--color-orange);
    box-shadow:
        0 2px 10px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(255, 107, 53, 0.15),
        inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.btn:active .btn-letter {
    text-shadow: 0 0 10px rgba(255, 107, 53, 0.8);
    color: var(--color-orange);
    animation: none;
}

.btn:active .btn-svg {
    transform: scale(0.95);
}

/* Hover state */
.btn:hover {
    background: rgba(255, 107, 53, 0.1);
    border-color: rgba(255, 107, 53, 0.35);
    color: #ff6b35;
}

.btn:hover .btn-svg {
    stroke: #ff6b35;
    filter: none;
    animation: none;
}

.btn:hover .btn-letter {
    color: #ff6b35;
    animation: none;
}

.btn:active {
    transform: scale(0.98);
}

/* Disabled state */
.btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* Generated state */
.btn.generated {
    background: rgba(255, 107, 53, 0.08);
    border-color: rgba(255, 107, 53, 0.3);
}

.btn.generated:hover {
    border-color: rgba(255, 107, 53, 0.5);
        0 0 50px rgba(255, 107, 53, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Generating animation - extends focus animation */
.btn.generating {
    pointer-events: none;
}

/* When generating, apply the focus-like animations */
.btn.generating .txt-1 {
    animation: opacity-anim 0.5s ease-in-out forwards;
    animation-delay: 0.8s;
}

.btn.generating .txt-2 {
    animation: opacity-anim 0.5s ease-in-out reverse forwards;
    animation-delay: 0.8s;
}

.btn.generating .btn-letter {
    animation: focused-letter-anim 1s ease-in-out forwards, letter-anim 1.2s ease-in-out infinite;
    animation-delay: 0s, 1s;
}

.btn.generating .btn-svg {
    filter: drop-shadow(0 0 12px rgba(255, 107, 53, 0.9));
}

@keyframes starSpin {
    0% {
        transform: rotate(0deg) scale(1);
        filter: drop-shadow(0 0 4px rgba(255, 107, 53, 0.5));
    }
    25% {
        transform: rotate(90deg) scale(1.2);
        filter: drop-shadow(0 0 15px rgba(255, 107, 53, 0.9));
    }
    50% {
        transform: rotate(180deg) scale(1.3);
        filter: drop-shadow(0 0 20px rgba(255, 107, 53, 1));
    }
    75% {
        transform: rotate(270deg) scale(1.2);
        filter: drop-shadow(0 0 15px rgba(255, 107, 53, 0.9));
    }
    100% {
        transform: rotate(360deg) scale(1);
        filter: drop-shadow(0 0 12px rgba(255, 107, 53, 0.9));
    }
}

.btn.generating::before {
    opacity: 1;
}

/* Subtle glow pulse during generation */
.btn.generating {
    animation: generatingGlow 1s ease-in-out infinite;
}

@keyframes generatingGlow {
    0%, 100% {
        box-shadow:
            0 4px 20px rgba(0, 0, 0, 0.3),
            0 0 30px rgba(255, 107, 53, 0.15),
            inset 0 1px 0 rgba(255, 255, 255, 0.1);
    }
    50% {
        box-shadow:
            0 4px 25px rgba(0, 0, 0, 0.35),
            0 0 50px rgba(255, 107, 53, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.15);
    }
}

/* Success flash animation */
@keyframes successFlash {
    0% {
        box-shadow:
            0 4px 20px rgba(0, 0, 0, 0.3),
            0 0 30px rgba(255, 107, 53, 0.08),
            inset 0 1px 0 rgba(255, 255, 255, 0.1);
    }
    50% {
        box-shadow:
            0 4px 30px rgba(255, 107, 53, 0.5),
            0 0 60px rgba(255, 107, 53, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }
    100% {
        box-shadow:
            0 4px 20px rgba(255, 107, 53, 0.2),
            0 0 40px rgba(255, 107, 53, 0.1),
            inset 0 1px 0 rgba(255, 255, 255, 0.1);
    }
}

.btn.success-flash {
    animation: successFlash 0.6s ease-out;
}

/* Token display in button */
.btn-token-display {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-width: 0;
    font-family: 'Courier New', 'SF Mono', monospace;
    font-size: 0.95em;
    letter-spacing: 0.04em;
    word-break: break-all;
    text-align: center;
    padding: 0 0.5rem;
    animation: tokenReveal 0.6s ease-out;
}

@keyframes tokenReveal {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(10px);
        filter: blur(8px);
    }
    50% {
        opacity: 0.7;
        filter: blur(2px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
        filter: blur(0);
    }
}

.btn-token-display .token-text {
    color: var(--color-orange);
    font-weight: 700;
    font-size: 1em;
    transition: all 0.3s ease;
    text-shadow: 0 0 12px rgba(255, 107, 53, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.btn-token-display .token-text.copied {
    color: #4ade80;
    font-size: 1.1em;
    font-weight: 700;
    text-shadow: 0 0 15px rgba(74, 222, 128, 0.6);
    animation: copiedPulse 0.4s ease-out;
}

@keyframes copiedPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* Mobile responsive - Button */
@media (max-width: 768px) {
    .btn {
        font-size: 0.95rem;
        padding: 0.875rem 1.5rem;
        min-height: 52px;
    }
    
    .btn-svg {
        height: 20px;
        width: 20px;
        margin-right: 0.5rem;
    }
    
    .register-buttons .btn .btn-svg {
        margin-right: 0.5rem;
    }
    
    .btn-token-display {
        font-size: 0.85em;
        padding: 0 0.35rem;
        letter-spacing: 0.02em;
    }
    
    .btn-token-display .token-text {
        font-size: 0.95em;
    }
    
    .btn-token-display .token-text.copied {
        font-size: 1.05em;
    }
    
    .txt-wrapper {
        min-width: 7em;
    }
}

/* Override icon margin on narrow screens (after 768px, so it doesn't get overwritten) */
@media (max-width: 480px) {
    .btn-svg {
        margin-right: 0.85rem;
    }
    .register-buttons .btn .btn-svg {
        margin-right: 0.85rem;
    }
}

/* Extra small screens */
@media (max-width: 420px) {
    .btn {
        padding: 0.75rem 1.25rem;
    }
    
    .btn-token-display {
        font-size: 0.75em;
        letter-spacing: 0.01em;
    }
    
    .btn-token-display .token-text {
        font-size: 0.9em;
    }
    
    .txt-wrapper {
        min-width: 6em;
    }
}

/* Very small screens */
@media (max-width: 360px) {
    .btn-svg {
        margin-right: 0.75rem;
    }
    
    .register-buttons .btn .btn-svg {
        margin-right: 0.75rem;
    }
    
    .btn-token-display {
        font-size: 0.65em;
    }
    
    .btn-token-display .token-text {
        font-size: 0.85em;
    }
}
