/* ===== AUTH PAGES STYLES ===== */

/* Wrapper - centers card on screen */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    z-index: 10;
}

/* Auth Card */
.auth-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-radius: var(--radius);
    padding: 3rem 2.5rem;
    width: 100%;
    max-width: 460px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    animation: authCardIn 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.verify-card {
    max-width: 560px;
}

@keyframes authCardIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Logo */
.auth-logo {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-logo .logo-icon-wrap {
    width: 70px;
    height: 70px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.15), rgba(168, 85, 247, 0.15));
    position: relative;
    font-size: 1.8rem;
    color: var(--accent-blue);
}

.auth-logo h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
}

.auth-logo h1 .accent {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Badge */
.auth-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1.2rem;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.08), rgba(168, 85, 247, 0.08));
    border: 1px solid rgba(0, 212, 255, 0.15);
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--accent-blue);
    margin: 0 auto 2rem;
    width: fit-content;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.verify-badge {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(239, 68, 68, 0.08));
    border-color: rgba(245, 158, 11, 0.2);
    color: var(--accent-orange);
}

/* Form */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.8rem;
}

.auth-form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.auth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-wrap > .input-icon {
    position: absolute;
    left: 1.2rem;
    padding: 0 !important;
    color: var(--text-muted);
    font-size: 1rem;
    z-index: 2;
    transition: var(--transition);
}

.auth-form .auth-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3.5rem;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
}

.auth-input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1), 0 0 20px rgba(0, 212, 255, 0.05);
}

.auth-input:focus ~ .input-glow,
.auth-input:focus + .toggle-password + .input-glow {
    opacity: 1;
}

.auth-input:focus ~ .input-icon,
.auth-input-wrap:focus-within > .input-icon {
    color: var(--accent-blue);
}

.input-glow {
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    border-radius: 2px;
    transition: var(--transition);
    opacity: 0;
}

.auth-input:focus ~ .input-glow,
.auth-input:focus + .toggle-password + .input-glow {
    width: 100%;
    opacity: 1;
}

.toggle-password {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    z-index: 2;
    transition: var(--transition);
}

.toggle-password:hover {
    color: var(--accent-blue);
}

/* Remember me */
.auth-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.remember-me input[type="checkbox"] {
    display: none;
}

.remember-me .checkmark {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1.5px solid var(--border-color);
    background: var(--input-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    position: relative;
}

.remember-me .checkmark::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.6rem;
    color: white;
    opacity: 0;
    transition: var(--transition);
}

.remember-me input:checked + .checkmark {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
}

.remember-me input:checked + .checkmark::after {
    opacity: 1;
}

/* Error / Success messages */
.auth-error,
.auth-success {
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1rem;
    border-radius: var(--radius-xs);
    font-size: 0.85rem;
    font-weight: 500;
    animation: shakeIn 0.4s ease;
}

.auth-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--accent-red);
}

.auth-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: var(--accent-green);
}

.auth-error.show,
.auth-success.show {
    display: flex;
}

@keyframes shakeIn {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* Submit button */
.auth-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 1rem;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.auth-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--glow-blue);
}

.auth-submit-btn:active {
    transform: translateY(0);
}

.auth-submit-btn.loading {
    pointer-events: none;
    opacity: 0.8;
}

.auth-submit-btn.loading span {
    visibility: hidden;
}

.auth-submit-btn.loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Footer */
.auth-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.auth-security-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--accent-green);
    margin-bottom: 0.8rem;
}

.auth-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.auth-hint strong {
    color: var(--accent-blue);
    font-family: 'JetBrains Mono', monospace;
}

/* Side decorations */
.auth-side-decor {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auth-side-decor.left {
    left: 2rem;
}

.auth-side-decor.right {
    right: 2rem;
}

.auth-side-decor .decor-line {
    width: 3px;
    height: 60px;
    border-radius: 3px;
    background: var(--gradient-primary);
    opacity: 0.15;
    animation: decorPulse 3s ease-in-out infinite;
}

.auth-side-decor .decor-line:nth-child(2) {
    height: 100px;
    opacity: 0.25;
    animation-delay: 0.5s;
}

.auth-side-decor .decor-line:nth-child(3) {
    height: 40px;
    opacity: 0.1;
    animation-delay: 1s;
}

@keyframes decorPulse {
    0%, 100% { opacity: 0.1; }
    50% { opacity: 0.3; }
}

/* ===== VERIFICATION PAGE ===== */
.verify-intro {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* Challenge container */
.verify-challenge {
    margin-bottom: 1.5rem;
}

.challenge-question {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.2rem;
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    line-height: 1.5;
}

.challenge-question i {
    color: var(--accent-orange);
    margin-top: 0.2rem;
    flex-shrink: 0;
}

/* Challenge options */
.challenge-options {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.challenge-option {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem 1.2rem;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    width: 100%;
}

.challenge-option:hover {
    border-color: var(--accent-blue);
    background: rgba(0, 212, 255, 0.05);
    transform: translateX(4px);
}

.challenge-option i {
    color: var(--text-muted);
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.challenge-option.correct {
    border-color: var(--accent-green);
    background: rgba(34, 197, 94, 0.1);
    color: var(--accent-green);
}

.challenge-option.correct i {
    color: var(--accent-green);
}

.challenge-option.wrong {
    border-color: var(--accent-red);
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-red);
    animation: shakeIn 0.4s ease;
}

.challenge-option.wrong i {
    color: var(--accent-red);
}

.challenge-option:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* Code block in challenge */
.challenge-code {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xs);
    padding: 0.8rem 1rem;
    margin-bottom: 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--accent-blue);
    overflow-x: auto;
    word-break: break-all;
}

/* Progress bar */
.verify-progress {
    margin-top: 1.5rem;
}

.verify-progress-bar {
    width: 100%;
    height: 4px;
    background: var(--input-bg);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.verify-progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 4px;
    transition: width 0.5s ease;
    width: 0%;
}

.verify-progress-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    display: block;
}

/* ===== PHONE INPUT WITH COUNTRY CODE ===== */
.phone-input-group {
    display: flex;
    align-items: stretch;
    gap: 0.6rem;
    height: 50px;
}

.country-code-select {
    width: 120px;
    flex-shrink: 0;
    padding: 0 1.8rem 0 0.9rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    outline: none;
    transition: var(--transition);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2300d4ff' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    text-align: center;
}

.country-code-select:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(0, 212, 255, 0.3);
}

.country-code-select:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1), 0 0 15px rgba(0, 212, 255, 0.05);
    background-color: rgba(0, 212, 255, 0.05);
}

.country-code-select option {
    background: #0a0f25;
    color: var(--text-primary);
    padding: 0.5rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
}

.phone-input-group .auth-input {
    flex: 1;
    padding: 0 1rem !important;
    height: 100%;
    border-radius: var(--radius-sm);
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
}

.phone-input-group .auth-input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1), 0 0 20px rgba(0, 212, 255, 0.05);
}

.phone-input-group .auth-input::placeholder {
    color: var(--text-muted);
}

/* Two column row */
.auth-form-row {
    display: flex;
    gap: 1rem;
}

.auth-form-row .auth-form-group {
    flex: 1;
}

/* ===== CHATBOT ===== */
.chatbot-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--gradient-primary);
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--glow-blue);
    transition: var(--transition);
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 0 40px rgba(0, 212, 255, 0.4);
}

.chatbot-toggle .chat-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-green);
    border: 2px solid var(--bg-primary);
}

.chatbot-panel {
    position: fixed;
    bottom: 6rem;
    right: 2rem;
    width: 380px;
    max-height: 520px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-radius: var(--radius);
    border: 1px solid var(--glass-border);
    z-index: 9998;
    display: none;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: chatSlideUp 0.3s ease;
}

.chatbot-panel.open {
    display: flex;
}

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

.chatbot-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem 1.2rem;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(168, 85, 247, 0.1));
    border-bottom: 1px solid var(--border-color);
}

.chatbot-header-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    flex-shrink: 0;
}

.chatbot-header-info h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.chatbot-header-info span {
    font-size: 0.72rem;
    color: var(--accent-green);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.chatbot-header-info span::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-green);
    display: inline-block;
}

.chatbot-close {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.chatbot-close:hover {
    color: var(--accent-red);
}

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    max-height: 350px;
    min-height: 250px;
}

.chat-msg {
    max-width: 85%;
    padding: 0.7rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    line-height: 1.5;
    animation: chatMsgIn 0.3s ease;
}

@keyframes chatMsgIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-msg.bot {
    background: rgba(0, 212, 255, 0.08);
    border: 1px solid rgba(0, 212, 255, 0.12);
    color: var(--text-primary);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.chat-msg.user {
    background: var(--gradient-primary);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.chat-msg.bot .msg-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--accent-blue);
    margin-bottom: 0.3rem;
    display: block;
}

.chat-typing {
    display: flex;
    gap: 4px;
    padding: 0.7rem 1rem;
    align-self: flex-start;
}

.chat-typing span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-blue);
    animation: typingDot 1.2s infinite;
}

.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingDot {
    0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); }
    30% { opacity: 1; transform: scale(1); }
}

.chatbot-input-area {
    display: flex;
    gap: 0.5rem;
    padding: 0.8rem 1rem;
    border-top: 1px solid var(--border-color);
}

.chatbot-input {
    flex: 1;
    padding: 0.7rem 1rem;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xs);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    outline: none;
    transition: var(--transition);
}

.chatbot-input:focus {
    border-color: var(--accent-blue);
}

.chatbot-input::placeholder {
    color: var(--text-muted);
}

.chatbot-send {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-xs);
    background: var(--gradient-primary);
    border: none;
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.chatbot-send:hover {
    transform: scale(1.05);
}

/* ===== REGISTER PAGE ===== */
.register-badge {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.08), rgba(0, 212, 255, 0.08));
    border-color: rgba(34, 197, 94, 0.2);
    color: var(--accent-green);
}

.field-hint {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
    padding-left: 0.2rem;
}

/* Password strength meter */
.password-strength {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-top: 0.5rem;
}

.strength-bars {
    display: flex;
    gap: 4px;
    flex: 1;
}

.strength-bar {
    height: 4px;
    flex: 1;
    border-radius: 4px;
    background: var(--border-color);
    opacity: 0.3;
    transition: var(--transition);
}

.strength-text {
    font-size: 0.72rem;
    font-weight: 600;
    min-width: 45px;
    text-align: right;
}

/* Auth switch link */
.auth-switch {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.8rem;
}

.auth-link {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.auth-link:hover {
    color: var(--accent-purple);
    text-decoration: underline;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
    .auth-card {
        padding: 2rem 1.5rem;
        margin: 1rem;
    }

    .auth-side-decor {
        display: none;
    }

    .auth-logo h1 {
        font-size: 1.3rem;
    }

    .challenge-code {
        font-size: 0.75rem;
    }

    .chatbot-panel {
        width: calc(100vw - 2rem);
        right: 1rem;
        bottom: 5rem;
        max-height: 70vh;
    }

    .chatbot-toggle {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 52px;
        height: 52px;
    }

    .phone-input-group {
        flex-direction: column;
        height: auto;
        gap: 0.5rem;
    }

    .country-code-select {
        width: 100%;
        height: 46px;
        border-radius: 50px;
    }

    .phone-input-group .auth-input {
        height: 46px;
    }

    .auth-form-row {
        flex-direction: column;
        gap: 1.8rem;
    }
}
