/* Phone Login Styles */

/* Alternative Login Section */
.alternative-login {
    margin-top: 16px;
}

.divider {
    text-align: center;
    margin: 12px 0;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-default);
}

.divider span {
    background: var(--bg-secondary);
    padding: 0 16px;
    position: relative;
    color: var(--text-tertiary);
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.5px;
}

/* Phone Login Button */
.phone-login-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--bg-hover);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.phone-login-btn:hover {
    background: var(--bg-active);
    border-color: var(--border-hover);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.phone-login-btn:active {
    transform: translateY(0);
}

.phone-login-btn svg {
    flex-shrink: 0;
}

/* Phone Login Wizard */
.phone-login-wizard {
    animation: fadeIn 0.4s ease;
}

.phone-step {
    display: none;
    animation: slideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.phone-step.active {
    display: block;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Step Header */
.step-header {
    margin-bottom: 32px;
}

.back-to-login,
.back-to-phone {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 12px;
    margin: -8px -12px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.back-to-login:hover,
.back-to-phone:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Phone Login Content */
.phone-login-content {
    text-align: center;
}

.phone-icon-large,
.verify-icon-large {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: var(--bg-hover);
    border-radius: 50%;
    margin-bottom: 24px;
    animation: iconBounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes iconBounce {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.phone-login-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.phone-login-description {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.5;
}

.phone-login-description #sent-to-number {
    color: var(--text-primary);
    font-weight: 600;
}

/* Phone Login Form */
.phone-login-form,
.verify-code-form {
    margin-top: 24px;
}

/* Code Input Group */
.code-input-group {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 32px;
}

.code-input {
    width: 48px;
    height: 56px;
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    background: var(--bg-input);
    border: 2px solid var(--border-default);
    border-radius: 12px;
    color: var(--text-primary);
    transition: all 0.2s ease;
    caret-color: var(--primary-2);
}

.code-input:hover {
    border-color: var(--border-hover);
}

.code-input:focus {
    outline: none;
    border-color: var(--border-focus);
    background: var(--bg-hover);
    transform: scale(1.05);
}

.code-input.filled {
    border-color: var(--success);
    background: var(--success-bg);
    animation: codeSuccess 0.3s ease;
}

@keyframes codeSuccess {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.code-input.error {
    border-color: var(--error);
    background: var(--error-bg);
    animation: shake 0.5s ease-in-out;
}

/* Resend Section */
.resend-section {
    text-align: center;
    margin-bottom: 24px;
}

.resend-btn {
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.resend-btn:not(:disabled):hover {
    background: var(--bg-hover);
    color: var(--primary-2);
}

.resend-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.resend-timer {
    color: var(--text-muted);
    font-weight: 400;
}

/* Loading State for SMS */
.sending-sms {
    position: relative;
    overflow: hidden;
}

.sending-sms::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.2), transparent);
    animation: smsWave 1.5s ease-in-out infinite;
}

@keyframes smsWave {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Success Animation */
.phone-success {
    text-align: center;
    padding: 40px 20px;
}

.success-checkmark {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    position: relative;
}

.success-checkmark svg {
    width: 100%;
    height: 100%;
}

.success-checkmark circle {
    fill: none;
    stroke: var(--success);
    stroke-width: 2;
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    animation: circleAnimation 0.6s ease-out forwards;
}

.success-checkmark path {
    fill: none;
    stroke: var(--success);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: checkAnimation 0.4s ease-out 0.4s forwards;
}

@keyframes circleAnimation {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes checkAnimation {
    to {
        stroke-dashoffset: 0;
    }
}

/* Mobile Adjustments */
@media (max-width: 480px) {
    .phone-icon-large,
    .verify-icon-large {
        width: 64px;
        height: 64px;
    }
    
    .phone-login-title {
        font-size: 20px;
    }
    
    .code-input-group {
        gap: 8px;
    }
    
    .code-input {
        width: 42px;
        height: 48px;
        font-size: 20px;
    }
    
    /* Fix input zoom on iOS */
    #login-phone {
        font-size: 16px;
    }
}

/* Light Theme Adjustments */
[data-theme="light"] .phone-login-btn {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .phone-login-btn:hover {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .phone-icon-large,
[data-theme="light"] .verify-icon-large {
    background: rgba(102, 126, 234, 0.08);
}

[data-theme="light"] .code-input {
    background: white;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}