/* Auth Tabs Container - Single Rounded Pill Design */
.auth-tabs {
    display: inline-flex;
    background: #f8f8f8;
    border-radius: 25px;
    padding: 4px;
    margin: 20px auto 10px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* Tab Buttons */
.auth-tab {
    padding: 10px 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #888;
    transition: all 0.25s ease;
    border-radius: 21px;
    min-width: 100px;
}

/* Active Tab */
.auth-tab.active {
    background: #0087c4;
    color: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 135, 196, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Tab Hover */
.auth-tab:hover:not(.active) {
    color: #0087c4;
    background: rgba(0, 135, 196, 0.08);
}

/* Hash Input Field - match existing Windscribe input styling with anonymity icon */
.hash-input {
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
    width: 100%;
    height: 60px;
    padding: 0 60px 0 60px;
    border: 1px solid rgba(50,50,50,0.1);
    border-radius: 6px;
    font-size: 0.75em;
    font-weight: 200;
    box-sizing: border-box;
    background-color: #ffffff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='27' height='27' viewBox='0 0 24 24' fill='none' stroke='%230087c4' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2z'%3E%3C/path%3E%3Cpath d='M8 9h8M8 15h8'%3E%3C/path%3E%3Ccircle cx='8' cy='12' r='1.2'%3E%3C/circle%3E%3Ccircle cx='16' cy='12' r='1.2'%3E%3C/circle%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 17px center;
    background-size: 27px 27px;
    transition: all 0.2s ease;
    position: relative;
}

.hash-input:focus {
    outline: none;
    border-color: #00a8e1;
}

/* Drag and drop states */
.hash-input.drag-over {
    border-color: #00a8e1 !important;
    background-color: rgba(0, 168, 225, 0.05);
    border-style: dashed;
    border-width: 2px;
}

.hash-input.hashing {
    background-color: #f8f9fa;
    cursor: wait;
}

/* Hash input wrapper for icon positioning */
.hash-input-wrapper {
    position: relative;
    width: 100%;
}

/* Fade background behind action icons to prevent text overlap */
.hash-input-wrapper::after {
    content: '';
    position: absolute;
    right: 1px;
    top: 1px;
    bottom: 1px;
    width: 80px;
    background: linear-gradient(to right, transparent, #ffffff 30%);
    pointer-events: none;
    z-index: 5;
    border-radius: 0 5px 5px 0;
}

/* Hash action icons (browse/generate) */
.hash-action-icon {
    position: absolute;
    right: 22px;
    top: 19px;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease;
    z-index: 10;
    opacity: 0.85;
}

.hash-action-icon:hover {
    transform: scale(1.08);
    opacity: 1;
}

.hash-action-icon:active {
    transform: scale(0.92);
}

.hash-action-icon svg {
    width: 20px;
    height: 20px;
    display: block;
}

/* Position multiple icons */
.hash-action-icon.browse-icon {
    right: 22px;
}

.hash-action-icon.generate-icon {
    right: 50px;
}

/* Hidden file input */
.hash-file-input {
    display: none;
}

/* Form Mode Visibility */
.form-mode {
    display: none;
}

.form-mode.active {
    display: block;
}

/* Wider container for hashed mode */
#hashed-mode {
    max-width: 520px;
    margin: 0 auto;
}

/* Make 2FA and voucher fields in hashed mode match hash input width */
#hashed-mode .code_2fa,
#hashed-mode .voucher {
    max-width: 100%;
}

/* Override parent container max-width for hashed mode */
.login .login-box:has(#hashed-mode.active) {
    max-width: 520px;
}

.signup #hashed-mode.active .signup-box {
    max-width: 520px;
}

/* Error Message Styling for Auth Pages */
.login .content_message,
.signup .content_message {
    max-width: 380px;
    width: 100%;
    margin: 0 auto 25px;
    border-radius: 12px;
    padding: 16px 18px;
    font-weight: 500;
    font-size: 14px;
    line-height: 1.6;
    animation: slideDown 0.3s ease;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 14px;
    text-align: left;
}

/* Wider error box for hashed mode - matches form field width */
.hash-mode-active .login .content_message,
.hash-mode-active .signup .content_message {
    max-width: 520px;
}

.login .content_message.error,
.signup .content_message.error {
    background: #fef5f5;
    border: 1.5px solid #f5c6cb;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.08), 0 1px 3px rgba(220, 53, 69, 0.06);
    color: #721c24;
}

/* Icon container for error message */
.login .content_message.error::before,
.signup .content_message.error::before {
    content: "⚠";
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(220, 53, 69, 0.1);
    border-radius: 6px;
    color: #dc3545;
}

/* Slide down animation */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hash Info Notice - Clean Modern Design */
.hash-info-notice {
    max-width: 520px;
    margin: 0 auto 24px;
    background: rgba(0, 135, 196, 0.04);
    border: 1px solid rgba(0, 135, 196, 0.2);
    border-radius: 10px;
    padding: 18px 20px;
    box-sizing: border-box;
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.hash-info-icon {
    flex-shrink: 0;
    color: #0087c4;
    margin-top: 1px;
}

.hash-info-text {
    flex: 1;
    text-align: left;
}

.hash-info-text strong {
    display: block;
    color: #2c3e50;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 5px;
    letter-spacing: -0.01em;
}

.hash-info-text span {
    display: block;
    color: #546e7a;
    font-size: 13px;
    line-height: 1.6;
}

/* Hash Backup Checkbox */
.hash-backup-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(0, 135, 196, 0.15);
    cursor: pointer;
    user-select: none;
}

.hash-backup-checkbox input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px;
    max-width: 18px;
    border: 2px solid #b0bec5;
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    transition: all 0.15s ease;
    flex-shrink: 0;
    background: #ffffff;
    margin: 0;
    padding: 0 !important;
}

.hash-backup-checkbox input[type="checkbox"]:hover {
    border-color: #0087c4;
}

.hash-backup-checkbox input[type="checkbox"]:checked {
    background: #0087c4;
    border-color: #0087c4;
}

.hash-backup-checkbox input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 4px;
    height: 9px;
    border: solid white;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
}

.hash-backup-checkbox label {
    color: #546e7a;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    flex: 1;
    line-height: 1.4;
}

/* Auth header link - appears below tabs on signup */
.auth-header-link {
    text-align: center;
    font-size: 15px;
    color: #546e7a;
    margin: 16px auto 8px;
}

.auth-header-link span {
    color: #78909c;
}

.auth-header-link a {
    color: #0087c4;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    border-bottom: 1px dashed rgba(0, 135, 196, 0.5);
    padding-bottom: 1px;
}

.auth-header-link a:hover {
    color: #006699;
    border-bottom-style: solid;
    border-bottom-color: #006699;
}

/* Auth footer link styling */
.auth-footer-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(0, 0, 0, 0.1), transparent);
    margin: 24px auto 18px;
    max-width: 380px;
}

/* Wider footer divider for hashed mode */
.hash-mode-active .auth-footer-divider {
    max-width: 520px;
}

.auth-footer-link {
    text-align: center;
    font-size: 15px;
    color: #546e7a;
    margin: 0 auto 20px;
}

.auth-footer-link span {
    color: #78909c;
}

.auth-footer-link a {
    color: #0087c4;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
    border-bottom: 1px solid transparent;
}

.auth-footer-link a:hover {
    color: #00a8e1;
    border-bottom-color: #00a8e1;
}

/* Footer links - kept for backwards compatibility */
.auth-footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 auto 24px;
    font-size: 14px;
}

.auth-footer-separator {
    color: #cbd5e0;
    font-size: 18px;
    line-height: 1;
    user-select: none;
}

.auth-footer-links a {
    color: #64748b;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    padding: 6px 0;
}

.auth-footer-links a:hover {
    color: #0087c4;
}

/* Secondary action links - simple text style matching other helper links */
.signup .have_voucher,
.login .have_2fa {
    display: block;
    width: fit-content;
    text-align: center;
    margin: 24px auto 20px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    color: #0087c4;
    text-decoration: none;
    transition: all 0.2s ease;
    border-bottom: 1px dashed rgba(0, 135, 196, 0.5);
    padding-bottom: 1px;
}

.signup .have_voucher:hover,
.login .have_2fa:hover {
    color: #006699;
    border-bottom-style: solid;
    border-bottom-color: #006699;
}


/* Mobile Responsive - Consistent spacing for all auth forms */
@media (max-width: 768px) {
    /* Prevent horizontal scroll on auth pages */
    .login,
    .signup,
    .white-section.login,
    .white-section.signup {
        overflow-x: hidden;
    }
    
    /* Consistent padding for ALL form containers - both standard and hashed */
    #login_cont,
    #signup_cont {
        padding: 0 16px;
        box-sizing: border-box;
    }
    
    /* Override fixed widths from windscribe.css for mobile */
    .login .login-box,
    .signup .signup-box {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }
    
    /* Form mode containers */
    #standard-mode,
    #hashed-mode {
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Constrain hash info notice */
    .hash-info-notice {
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* Constrain all inputs */
    .hash-input-wrapper,
    .hash-input,
    #hashed-mode .voucher,
    .login .login-box input,
    .signup .signup-box input {
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Error messages and footer */
    .login .content_message,
    .signup .content_message,
    .auth-footer-divider {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .auth-tab {
        padding: 8px 20px;
    }
    
    .hash-input {
        font-size: 14px;
        padding-left: 50px;
        padding-right: 50px;
    }
    
    /* Reposition action icons on small screens */
    .hash-action-icon.browse-icon {
        right: 12px;
    }
    
    .hash-action-icon.generate-icon {
        right: 40px;
    }
    
    .login .content_message,
    .signup .content_message {
        font-size: 13px;
        padding: 14px 14px;
        margin: 0 auto 20px;
        max-width: 100%;
    }
    
    .hash-info-notice {
        font-size: 13px;
        padding: 14px 16px;
    }
    
    .auth-footer-divider {
        margin: 20px auto 16px;
        max-width: 100%;
    }
    
    .auth-footer-link {
        font-size: 14px;
        margin: 0 auto 16px;
    }
    
    .auth-footer-links {
        flex-direction: column;
        gap: 12px;
        font-size: 14px;
    }
    
    .auth-footer-separator {
        display: none;
    }
    
    /* 2FA and voucher links on mobile */
    .login .have_2fa,
    .signup .have_voucher {
        font-size: 14px;
    }
}