/**
 * DeepDebate Shared Authentication Styles
 * Modern, iOS-inspired design matching the app
 */

/* ==============================================
   AUTH WRAPPER
   ============================================== */

.dd-auth-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    z-index: 9999;
    padding: 1rem;
    padding-top: 80px;
    overflow-y: auto;
}

/* ==============================================
   AUTH NAV BAR
   ============================================== */

.dd-auth-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 10000;
}

.dd-auth-nav-container {
    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
}

.dd-auth-nav-logo {
    text-decoration: none;
}

.dd-auth-nav-logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #007AFF, #9433EB);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.dd-auth-nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.dd-auth-nav-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.dd-auth-nav-links a:hover {
    color: #fff;
}

.dd-auth-nav-cta {
    background: linear-gradient(135deg, #007AFF, #9433EB);
    color: #fff !important;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600 !important;
}

.dd-auth-nav-cta:hover {
    opacity: 0.9;
}

@media (max-width: 900px) {
    .dd-auth-nav-links a:not(.dd-auth-nav-cta) {
        display: none;
    }
}

@media (max-width: 480px) {
    .dd-auth-nav-container {
        padding: 0 1rem;
    }

    .dd-auth-nav-logo-text {
        font-size: 1.25rem;
    }

    .dd-auth-nav-cta {
        font-size: 0.8rem;
        padding: 0.4rem 0.75rem;
    }
}

.dd-auth-box {
    background: #fff;
    border-radius: 20px;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
}

/* ==============================================
   AUTH HEADER
   ============================================== */

.dd-auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.dd-auth-logo {
    margin-bottom: 1.5rem;
}

.dd-logo-text {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #007AFF, #9433EB);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.dd-auth-title {
    font-size: 1.75rem;
    font-weight: 300;
    color: #1a1a2e;
    margin: 0 0 0.5rem;
}

.dd-auth-subtitle {
    font-size: 0.95rem;
    color: #666;
    margin: 0;
}

/* ==============================================
   AUTH TABS
   ============================================== */

.dd-auth-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: #f5f5f7;
    padding: 4px;
    border-radius: 12px;
}

.dd-auth-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dd-auth-tab:hover {
    color: #1a1a2e;
}

.dd-auth-tab.active {
    background: #fff;
    color: #1a1a2e;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.dd-auth-tab svg {
    stroke: currentColor;
}

/* ==============================================
   COUNTRY SELECTOR
   ============================================== */

.dd-country-selector {
    position: relative;
    margin-bottom: 0.75rem;
}

.dd-country-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1rem;
    width: 100%;
    background: #f5f5f7;
    border: 1px solid #e5e5e7;
    border-radius: 12px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dd-country-btn:hover {
    border-color: #9433EB;
}

.dd-country-flag {
    font-size: 1.25rem;
}

.dd-country-dial {
    font-weight: 600;
    color: #1a1a2e;
}

.dd-country-btn svg {
    margin-left: auto;
    color: #666;
}

.dd-country-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e5e5e7;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    max-height: 300px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.dd-country-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dd-country-search {
    padding: 0.875rem 1rem;
    border: none;
    border-bottom: 1px solid #e5e5e7;
    font-size: 0.95rem;
    outline: none;
}

.dd-country-search::placeholder {
    color: #999;
}

.dd-country-list {
    overflow-y: auto;
    max-height: 240px;
}

.dd-country-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease;
}

.dd-country-option:hover {
    background: #f5f5f7;
}

.dd-country-option .dd-country-name {
    flex: 1;
    font-size: 0.9rem;
    color: #1a1a2e;
}

.dd-country-option .dd-country-dial {
    font-size: 0.85rem;
    color: #666;
}

/* ==============================================
   INPUT GROUPS
   ============================================== */

.dd-input-group {
    margin-bottom: 1rem;
}

.dd-input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: #1a1a2e;
    margin-bottom: 0.5rem;
}

.dd-input {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    border: 1px solid #e5e5e7;
    border-radius: 12px;
    background: #f5f5f7;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.dd-input:focus {
    outline: none;
    border-color: #9433EB;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(148, 51, 235, 0.1);
}

.dd-input::placeholder {
    color: #999;
}

/* ==============================================
   ERROR MESSAGES
   ============================================== */

.dd-error {
    display: none;
    background: #FEE2E2;
    color: #DC2626;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    text-align: center;
}

/* ==============================================
   RECAPTCHA
   ============================================== */

.dd-recaptcha {
    display: flex;
    justify-content: center;
    margin: 1rem 0;
    min-height: 78px;
}

/* ==============================================
   BUTTONS
   ============================================== */

.dd-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.dd-btn-primary {
    background: linear-gradient(135deg, #007AFF, #9433EB);
    color: #fff;
}

.dd-btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(148, 51, 235, 0.4);
}

.dd-btn-google {
    background: #fff;
    color: #1a1a2e;
    border: 1px solid #e5e5e7;
}

.dd-btn-google:hover:not(:disabled) {
    background: #f5f5f7;
    border-color: #ccc;
}

.dd-btn-link {
    background: none;
    color: #9433EB;
    font-weight: 500;
    padding: 0.5rem;
    margin-top: 0.5rem;
}

.dd-btn-link:hover:not(:disabled) {
    text-decoration: underline;
}

/* ==============================================
   DIVIDER
   ============================================== */

.dd-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: #999;
    font-size: 0.85rem;
}

.dd-divider::before,
.dd-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e5e5e7;
}

.dd-divider span {
    padding: 0 1rem;
}

/* ==============================================
   VERIFICATION SECTION
   ============================================== */

.dd-verification-section {
    text-align: center;
}

.dd-verification-header {
    margin-bottom: 1.5rem;
}

.dd-verification-header p {
    font-size: 0.95rem;
    color: #666;
    margin: 0 0 0.25rem;
}

.dd-verification-header strong {
    font-size: 1.1rem;
    color: #1a1a2e;
}

.dd-code-inputs {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.dd-code-input {
    width: 48px;
    height: 56px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    border: 2px solid #e5e5e7;
    border-radius: 12px;
    background: #f5f5f7;
    transition: all 0.2s ease;
}

.dd-code-input:focus {
    outline: none;
    border-color: #9433EB;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(148, 51, 235, 0.1);
}

/* ==============================================
   SPINNER
   ============================================== */

.dd-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: dd-spin 0.8s linear infinite;
}

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

/* ==============================================
   FOOTER
   ============================================== */

.dd-auth-footer {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.875rem;
    color: #666;
}

.dd-auth-footer a {
    color: #9433EB;
    text-decoration: none;
    font-weight: 500;
}

.dd-auth-footer a:hover {
    text-decoration: underline;
}

.dd-home-link {
    color: #666;
}

.dd-home-link:hover {
    color: #9433EB;
}

.dd-footer-sep {
    margin: 0 0.5rem;
    color: #ccc;
}

/* ==============================================
   ACCESS DENIED SCREEN
   ============================================== */

.dd-access-denied {
    text-align: center;
}

.dd-access-denied-icon {
    margin-bottom: 1.5rem;
}

.dd-access-denied-icon svg {
    color: #DC2626;
}

.dd-user-info {
    font-size: 0.95rem;
    color: #1a1a2e;
    font-weight: 500;
    margin-bottom: 2rem;
    padding: 0.75rem 1rem;
    background: #f5f5f7;
    border-radius: 10px;
}

/* ==============================================
   RESPONSIVE
   ============================================== */

@media (max-width: 480px) {
    .dd-auth-box {
        padding: 2rem 1.5rem;
        border-radius: 16px;
        max-height: 90vh;
        overflow-y: auto;
    }

    .dd-logo-text {
        font-size: 1.75rem;
    }

    .dd-auth-title {
        font-size: 1.5rem;
    }

    .dd-code-input {
        width: 42px;
        height: 50px;
        font-size: 1.25rem;
    }

    .dd-code-inputs {
        gap: 0.35rem;
    }

    .dd-input {
        padding: 0.75rem 0.875rem;
        font-size: 0.95rem;
    }

    .dd-btn {
        padding: 0.875rem;
        font-size: 0.95rem;
    }
}

@media (max-width: 360px) {
    .dd-code-input {
        width: 38px;
        height: 46px;
        font-size: 1.1rem;
    }
}
