:root {
    --bg: #f8f9fa;
    --card: #ffffff;
    --accent: #0066cc;
    --accent-dark: #003d99;
    --text: #1a1a1a;
    --text-muted: #666;
    --button-bg: linear-gradient(135deg, #0066cc 0%, #003d99 100%);
    --button-hover: linear-gradient(135deg, #0052a3 0%, #002966 100%);
    --error: #ef4444;
    --success: #10b981;
    --call-color: #6366f1;
    --border: #e5e7eb;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #f0f4ff 0%, #f9f5ff 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transition: background-color 0.3s ease;
}

.auth-container {
    background: var(--card);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 450px;
    padding: 40px;
}

.auth-step {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.auth-step.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

h1 {
    color: var(--text);
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: -10px;
    margin-bottom: 10px;
}

/* Phone Input Wrapper with Country Code and Flag */
.phone-input-wrapper {
    display: none;
}

.country-flag {
    display: none;
}

.country-code {
    display: none;
}

.phone-input-wrapper input {
    display: none;
}

.phone-input-wrapper input::placeholder {
    display: none;
}

/* Phone Call Interface (Ring Theme) */
.phone-call-interface {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    border-radius: 16px;
    color: white;
    margin-bottom: 20px;
}

.phone-icon {
    width: 70px;
    height: 70px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    animation: ringing 2s infinite;
}

.phone-icon svg {
    width: 35px;
    height: 35px;
    stroke: white;
}

@keyframes ringing {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(255, 255, 255, 0.1);
    }
}

.phone-call-interface h1 {
    color: white;
    font-size: 24px;
    margin-bottom: 8px;
}

.phone-display {
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 2px;
}

.otp-info {
    background: #f0f4ff;
    padding: 16px;
    border-radius: 12px;
    border-left: 4px solid var(--accent);
    margin-bottom: 15px;
}

.otp-instruction {
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.otp-instruction-sub {
    color: var(--text-muted);
    font-size: 13px;
    margin: 0;
}

.otp-inputs-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.otp-inputs-container label {
    color: var(--text);
    font-weight: 600;
    font-size: 14px;
}

.otp-boxes {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 15px 0;
    flex-wrap: wrap;
}

.otp-box {
    width: 50px;
    height: 60px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    background: white;
    color: var(--text);
    transition: all 0.3s ease;
    cursor: text;
}

.otp-box:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.otp-box:valid {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.05);
}

.otp-box::placeholder {
    color: #ccc;
    font-weight: 300;
}

label {
    color: var(--text);
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
}

input:not(.otp-box) {
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 16px;
    font-family: inherit;
    background: white;
    color: var(--text);
    transition: all 0.3s ease;
}

input:not(.otp-box):focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

input:not(.otp-box)::placeholder {
    color: #ccc;
}

.submit-btn {
    padding: 14px 16px;
    background: var(--button-bg);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.submit-btn:hover:not(:disabled) {
    background: var(--button-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 102, 204, 0.3);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.verify-btn {
    margin-top: 20px;
}

.resend-btn,
.back-btn,
.skip-btn {
    padding: 12px 16px;
    background: transparent;
    color: var(--accent);
    border: 2px solid var(--accent);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px;
}

.resend-btn:hover:not(:disabled),
.back-btn:hover:not(:disabled),
.skip-btn:hover:not(:disabled) {
    background: var(--accent);
    color: white;
    transform: translateY(-2px);
}

.resend-btn:disabled,
.back-btn:disabled,
.skip-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Address Header with Skip Button */
.address-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.address-header > div {
    flex: 1;
}

.skip-btn-top {
    padding: 10px 20px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.skip-btn-top:hover:not(:disabled) {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(239, 68, 68, 0.3);
}

.skip-btn-top:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Messages */
.message {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    animation: slideIn 0.3s ease-out;
    margin-bottom: 10px;
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.success-message {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive for Tablets */
@media (max-width: 768px) {
    .auth-container {
        padding: 30px 24px;
        border-radius: 16px;
    }

    h1 {
        font-size: 24px;
    }

    .auth-subtitle {
        font-size: 13px;
    }

    .otp-boxes {
        gap: 8px;
    }

    .otp-box {
        width: 45px;
        height: 55px;
        font-size: 20px;
    }
}

/* Mobile Responsive */
@media (max-width: 480px) {
    body {
        padding: 15px;
    }

    .auth-container {
        padding: 24px 18px;
        border-radius: 16px;
        max-width: 100%;
    }

    h1 {
        font-size: 22px;
    }

    .auth-subtitle {
        font-size: 12px;
        margin-top: -8px;
    }

    .phone-call-interface {
        padding: 24px 16px;
        margin-bottom: 16px;
    }

    .phone-icon {
        width: 60px;
        height: 60px;
        margin-bottom: 12px;
    }

    .phone-icon svg {
        width: 30px;
        height: 30px;
    }

    .phone-call-interface h1 {
        font-size: 20px;
        margin-bottom: 6px;
    }

    .phone-display {
        font-size: 14px;
    }

    .otp-info {
        padding: 12px;
        margin-bottom: 12px;
    }

    .otp-instruction {
        font-size: 13px;
        margin-bottom: 3px;
    }

    .otp-instruction-sub {
        font-size: 12px;
    }

    .otp-boxes {
        gap: 6px;
        margin: 12px 0;
    }

    .otp-box {
        width: 40px;
        height: 50px;
        font-size: 18px;
        border-radius: 8px;
    }

    label {
        font-size: 13px;
        margin-bottom: 6px;
    }

    input:not(.otp-box) {
        padding: 12px 14px;
        border-radius: 8px;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .address-header {
        flex-direction: column;
        gap: 12px;
    }

    .skip-btn-top {
        width: 100%;
        padding: 12px 16px;
        font-size: 15px;
    }

    .submit-btn {
        padding: 12px 14px;
        font-size: 15px;
        margin-top: 8px;
    }

    .verify-btn {
        margin-top: 16px;
    }

    .resend-btn,
    .back-btn,
    .skip-btn {
        padding: 10px 14px;
        font-size: 13px;
        margin-top: 6px;
    }

    .message {
        padding: 10px 14px;
        font-size: 13px;
        margin-bottom: 8px;
    }
}

/* Extra small phones */
@media (max-width: 360px) {
    .auth-container {
        padding: 18px 14px;
    }

    h1 {
        font-size: 20px;
    }

    .otp-boxes {
        gap: 4px;
    }

    .otp-box {
        width: 36px;
        height: 46px;
        font-size: 16px;
    }

    .phone-call-interface {
        padding: 20px 12px;
    }

    .phone-icon {
        width: 50px;
        height: 50px;
    }

    .phone-icon svg {
        width: 28px;
        height: 28px;
    }

    .address-header {
        flex-direction: column;
    }

    .skip-btn-top {
        width: 100%;
        padding: 10px 14px;
        font-size: 13px;
    }
}
