/**
 * Auth Page Styles — Dark Brand Theme
 *
 * Page-specific styles for authentication pages (login, register, etc.).
 * Base dark theme is set in auth_base.html inline styles.
 * This file handles component-level overrides and extras.
 */

/* ============================================================================
   AUTH LAYOUT
   ============================================================================ */

.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-card {
    width: 100%;
    max-width: 420px;
}

.auth-card--wide {
    max-width: 500px;
}

.auth-card--narrow {
    max-width: 360px;
}

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

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

.auth-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

/* ============================================================================
   AUTH ICON
   ============================================================================ */

.auth-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

.auth-icon--success {
    background: rgba(5, 193, 104, 0.15);
    color: #05C168;
}

.auth-icon--warning {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}

.auth-icon--purple {
    background: rgba(124, 58, 237, 0.15);
    color: #a78bfa;
}

/* ============================================================================
   AUTH FORM
   ============================================================================ */

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-form .form-group {
    margin-bottom: 0;
}

/* ============================================================================
   AUTH ALERTS — semi-transparent on dark
   ============================================================================ */

.auth-alert {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.auth-alert--success {
    background: rgba(5, 193, 104, 0.15);
    border: 1px solid rgba(5, 193, 104, 0.3);
    color: #6ee7b7;
}

.auth-alert--error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.auth-alert--info {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #93c5fd;
}

/* ============================================================================
   AUTH LINKS
   ============================================================================ */

.auth-links {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8125rem;
}

.auth-links p {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 0.5rem;
}

.auth-links a {
    color: #05C168;
    font-weight: 500;
}

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

/* ============================================================================
   SSO BUTTONS — semi-transparent on dark
   ============================================================================ */

.btn-sso {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
    text-decoration: none;
}

.btn-sso:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-sso:active {
    transform: translateY(0);
    box-shadow: none;
}

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

.btn-sso.loading {
    opacity: 0.7;
    pointer-events: none;
}

.btn-sso--github {
    margin-top: 0.75rem;
}

/* GitHub icon needs to be white on dark bg */
.btn-sso--github svg {
    fill: rgba(255, 255, 255, 0.9);
}

/* SSO Section wrapper */
.auth-sso-section {
    margin-bottom: 1.5rem;
}

/* ============================================================================
   AUTH HELPER TEXT
   ============================================================================ */

.auth-hint {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    text-align: center;
    margin-top: 0.75rem;
}

.form-hint--error {
    color: #fca5a5;
}

/* ============================================================================
   DOMAIN BADGE
   ============================================================================ */

.auth-domain-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: #6ee7b7;
    background: rgba(5, 193, 104, 0.1);
    border: 1px solid rgba(5, 193, 104, 0.2);
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    margin-top: 0.75rem;
}

.auth-domain-badge svg {
    width: 14px;
    height: 14px;
}

/* ============================================================================
   TRUST INDICATOR
   ============================================================================ */

.auth-trust-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.25rem;
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.35);
}

.auth-trust-text svg {
    color: #05C168;
}

/* ============================================================================
   SSO LOADING SPINNER
   ============================================================================ */

.btn-sso .spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: #05C168;
    border-radius: 50%;
    animation: auth-spin 0.6s linear infinite;
}

.btn-sso.loading .spinner {
    display: block;
}

.btn-sso.loading .btn-icon {
    display: none;
}

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

/* ============================================================================
   AUTH SUCCESS STATE
   ============================================================================ */

.auth-success {
    text-align: center;
    padding: 1.5rem 0;
}

.auth-success-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    background: rgba(5, 193, 104, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-success-icon svg {
    width: 32px;
    height: 32px;
    color: #05C168;
}

.auth-success-icon--purple {
    background: rgba(124, 58, 237, 0.15);
}

.auth-success-icon--purple svg {
    color: #a78bfa;
}

.auth-success h3 {
    margin: 0 0 0.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: #ffffff;
}

.auth-success p {
    margin: 0;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.5;
}

.auth-success strong {
    color: #ffffff;
}

/* ============================================================================
   AUTH ERROR STATE
   ============================================================================ */

.auth-error {
    text-align: center;
    padding: 1.5rem 0;
}

.auth-error-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    background: rgba(239, 68, 68, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-error-icon svg {
    width: 32px;
    height: 32px;
    color: #f87171;
}

.auth-error h3 {
    margin: 0 0 0.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: #ffffff;
}

.auth-error p {
    margin: 0;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.5;
}

/* ============================================================================
   AUTH NOTICE BOXES
   ============================================================================ */

.auth-notice {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.8125rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    line-height: 1.5;
}

.auth-notice svg {
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.auth-notice--warning {
    background: rgba(251, 191, 36, 0.12);
    border: 1px solid rgba(251, 191, 36, 0.25);
    color: #fde68a;
}

.auth-notice--warning svg {
    color: #fbbf24;
}

.auth-notice--info {
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.25);
    color: #93c5fd;
}

.auth-notice--note {
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.2);
    color: #fde68a;
    text-align: center;
    margin-top: 1.5rem;
}

.auth-notice--note a {
    color: #fde68a;
    font-weight: 500;
}

.auth-notice strong {
    color: #ffffff;
}

/* ============================================================================
   PASSWORD REQUIREMENTS
   ============================================================================ */

.password-requirements {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 0.875rem 1rem;
    margin-top: 0.5rem;
}

.password-requirements h4 {
    margin: 0 0 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.password-requirements ul {
    margin: 0;
    padding: 0 0 0 1rem;
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.6;
}

.password-requirements li {
    margin: 0;
}

.password-requirements li.met {
    color: #05C168;
}

.password-requirements li.met::marker {
    content: "\2713 ";
}

.password-requirements--simple {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 0.5rem;
    background: none;
    padding: 0;
}

/* ============================================================================
   WELCOME BANNER — adapted for dark glass card
   ============================================================================ */

.welcome-banner {
    background: rgba(124, 58, 237, 0.12);
    border: 1px solid rgba(124, 58, 237, 0.25);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.welcome-banner .welcome-icon {
    width: 40px;
    height: 40px;
    margin: 0 auto 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.welcome-banner .welcome-icon svg {
    width: 20px;
    height: 20px;
    color: #a78bfa;
}

.welcome-banner h3 {
    margin: 0 0 0.25rem;
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
}

.welcome-banner p {
    margin: 0;
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.6);
}

.welcome-banner .invite-context {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.375rem;
}

.welcome-banner .inviter-name {
    font-weight: 600;
    color: #a78bfa;
}

.welcome-banner .user-email-display {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.08);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    display: inline-block;
    margin-top: 0.5rem;
}

/* ============================================================================
   ASSIGNED ROLES
   ============================================================================ */

.assigned-roles {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.assigned-roles .roles-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.625rem;
}

.assigned-roles .roles-header svg {
    color: #a78bfa;
}

.assigned-roles .roles-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.assigned-roles .role-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    background: rgba(124, 58, 237, 0.15);
    color: #c4b5fd;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 500;
}

/* ============================================================================
   FORM ERROR
   ============================================================================ */

.form-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.8125rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.form-error svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ============================================================================
   PASSWORD STRENGTH INDICATOR
   ============================================================================ */

.password-strength {
    display: flex;
    gap: 4px;
    margin-top: 0.5rem;
}

.password-strength-bar {
    height: 4px;
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    transition: background-color 0.2s;
}

.password-strength-bar.active.weak {
    background: #f87171;
}

.password-strength-bar.active.medium {
    background: #fbbf24;
}

.password-strength-bar.active.strong {
    background: #05C168;
}

.password-strength-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 0.25rem;
}

/* ============================================================================
   PASSWORD TOGGLE
   ============================================================================ */

.form-input-wrapper {
    position: relative;
}

.form-input.has-toggle {
    padding-right: 2.75rem;
}

.password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    padding: 0.25rem;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover {
    color: rgba(255, 255, 255, 0.7);
}

.password-toggle svg {
    width: 20px;
    height: 20px;
}

.password-toggle .icon-hide {
    display: none;
}

.password-toggle.showing .icon-show {
    display: none;
}

.password-toggle.showing .icon-hide {
    display: block;
}

/* ============================================================================
   FORM CHECKBOX
   ============================================================================ */

.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    cursor: pointer;
}

.form-checkbox input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    border-radius: 4px;
    cursor: pointer;
    accent-color: #05C168;
    margin-top: 2px;
    flex-shrink: 0;
}

.form-checkbox span {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.4;
}

.form-checkbox a {
    color: #05C168;
    text-decoration: none;
}

.form-checkbox a:hover {
    text-decoration: underline;
}

/* ============================================================================
   BUTTON VARIANTS
   ============================================================================ */

.btn-primary--purple {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    color: #ffffff;
}

.btn-primary--purple:hover {
    background: linear-gradient(135deg, #6d28d9 0%, #5b21b6 100%);
}

/* ============================================================================
   AUTH ACTIONS
   ============================================================================ */

.auth-actions {
    margin-top: 1.5rem;
}

/* ============================================================================
   ERROR SHAKE ANIMATION
   ============================================================================ */

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

.auth-card--shake {
    animation: authShake 0.4s ease-out;
}

.form-input--error {
    border-color: rgba(239, 68, 68, 0.5) !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}

/* ============================================================================
   INPUT ICONS
   ============================================================================ */

.input-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: rgba(255, 255, 255, 0.3);
    pointer-events: none;
    transition: color 0.15s ease;
}

.form-input:focus ~ .input-icon,
.form-input.has-icon:focus + .input-icon {
    color: rgba(255, 255, 255, 0.5);
}

.form-input-wrapper:focus-within .input-icon {
    color: rgba(255, 255, 255, 0.5);
}

.form-input.has-icon {
    padding-left: 2.75rem;
}

/* ============================================================================
   REMEMBER ME
   ============================================================================ */

.auth-remember {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}
