/**
 * Custom Authentication Forms - BOTBUSTER Theme
 * Custom sign in/up forms with Clerk integration
 */

/* Override auth-section background for glassmorphism */
.auth-section {
    background: rgba(0, 0, 0, 0.5) !important;
    position: relative;
}

.auth-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 0;
    pointer-events: none;
}

/* Override hero-section to use page background instead */
.hero-section {
    background: transparent !important;
}

.hero-section::before {
    display: none !important;
}

.hero-section::after {
    display: none !important;
}

.auth-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 1rem 0;
    position: relative;
    z-index: 1;
    gap: 1rem;
}

/* Logo Image */
.auth-logo-image {
    width: 520px;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 30px rgba(220, 20, 60, 0.3));
}

/* Custom Auth Container */
.custom-auth-container {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

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

/* Form Title */
.custom-auth-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #ffffff;
    text-align: center;
    margin-bottom: 0.25rem;
    letter-spacing: -0.02em;
}

.custom-auth-subtitle {
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    margin-bottom: 1.25rem;
}

/* Social Buttons */
.custom-social-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.custom-social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.625rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #ffffff;
    font-size: 0.8125rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.custom-social-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.custom-social-btn:active {
    transform: translateY(0);
}

.custom-social-btn svg {
    width: 20px;
    height: 20px;
}

/* Divider */
.custom-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.25rem 0;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.custom-divider::before,
.custom-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

/* Form Fields */
.custom-form-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.custom-form-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 0.02em;
}

.custom-form-input {
    width: 100%;
    padding: 0.625rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #ffffff;
    font-size: 0.875rem;
    font-family: inherit;
    transition: all 0.2s ease;
}

.custom-form-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.custom-form-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--bb-red-primary, #bd001b);
    box-shadow: 0 0 0 3px rgba(189, 0, 27, 0.1);
}

.custom-form-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Error Messages */
.custom-error {
    display: none;
    padding: 0.75rem 1rem;
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.3);
    border-radius: 8px;
    color: #DC143C;
    font-size: 0.875rem;
}

.custom-error.visible {
    display: block;
}

.custom-field-error {
    font-size: 0.8125rem;
    color: #DC143C;
    margin-top: 0.25rem;
    display: none;
}

.custom-field-error.visible {
    display: block;
}

.custom-form-field.error .custom-form-input {
    border-color: #DC143C;
}

/* Success Messages */
.custom-success {
    display: none;
    padding: 0.75rem 1rem;
    background: rgba(46, 204, 113, 0.1);
    border: 1px solid rgba(46, 204, 113, 0.3);
    border-radius: 8px;
    color: #2ECC71;
    font-size: 0.875rem;
}

.custom-success.visible {
    display: block;
}

/* Submit Button */
.custom-submit-btn {
    width: 100%;
    padding: 0.625rem 1rem;
    background: linear-gradient(135deg, var(--bb-red-primary, #bd001b) 0%, var(--bb-red-dark, #8b0014) 100%);
    border: none;
    border-radius: 8px;
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 6px 20px rgba(189, 0, 27, 0.4);
}

.custom-submit-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--bb-red-hover, #d6001f) 0%, var(--bb-red-primary, #bd001b) 100%);
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(189, 0, 27, 0.5);
}

.custom-submit-btn:active:not(:disabled) {
    transform: translateY(0);
}

.custom-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Loading State */
.custom-submit-btn.loading {
    position: relative;
    color: transparent;
}

.custom-submit-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* Additional Options */
.custom-auth-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    margin-top: -0.25rem;
}

.custom-checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.custom-checkbox {
    width: 18px;
    height: 18px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    cursor: pointer;
    accent-color: var(--bb-red-primary, #bd001b);
}

.custom-checkbox-label {
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    user-select: none;
}

.custom-forgot-link {
    color: var(--bb-red-primary, #bd001b);
    text-decoration: none;
    transition: color 0.2s ease;
}

.custom-forgot-link:hover {
    color: var(--bb-red-hover, #d6001f);
}

/* Footer Links */
.custom-auth-footer {
    margin-top: 0.75rem;
    text-align: center;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
}

.custom-auth-footer a {
    color: var(--bb-red-primary, #bd001b);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.custom-auth-footer a:hover {
    color: var(--bb-red-hover, #d6001f);
}

/* Verification Code Input */
.custom-verification-container {
    display: none;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
}

.custom-verification-container.visible {
    display: flex;
}

.custom-code-inputs {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.custom-code-input {
    width: 48px;
    height: 56px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #ffffff;
}

.custom-code-input:focus {
    outline: none;
    border-color: var(--bb-red-primary, #bd001b);
    box-shadow: 0 0 0 3px rgba(189, 0, 27, 0.1);
}

/* Responsive */
@media (max-width: 640px) {
    .auth-logo-image {
        width: 150px;
    }

    .auth-content {
        gap: 1rem;
    }

    .custom-auth-container {
        max-width: 100%;
        padding: 1.5rem;
        margin: 0 1rem;
        border-radius: 16px;
    }

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

    .custom-auth-subtitle {
        font-size: 0.875rem;
    }

    .custom-form-input,
    .custom-social-btn {
        padding: 0.625rem 0.875rem;
        font-size: 0.875rem;
    }

    .custom-code-inputs {
        gap: 0.5rem;
    }

    .custom-code-input {
        width: 40px;
        height: 48px;
        font-size: 1.25rem;
    }

    .custom-auth-options {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
}

@media (min-width: 641px) and (max-width: 1024px) {
    .custom-auth-container {
        padding: 2rem;
        margin: 0 1.5rem;
    }
}

/* Dark Mode (already dark, but for consistency) */
@media (prefers-color-scheme: dark) {
    /* Already optimized for dark theme */
}
