/**
 * Authentication Pages — Themed Styles
 * Split-screen design with animated left panel and form on right.
 * All colors use --abl-* variables from abl-common-ui-themes.css.
 * @version 2.0.0
 */

/* ============================================
   RESET & BASE
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: var(--font-family-base);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-top: 0; /* Override base.css 60px header space — auth pages have no header */
}

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

.abl-auth-login-container {
    display: flex;
    flex: 1;
    width: 100%;
    min-height: 0;
}

/* ============================================
   LEFT PANEL — ANIMATED VISUAL
   ============================================ */

.abl-auth-login-left {
    flex: 1;
    background: linear-gradient(135deg, #0ED9B4 0%, #7B61FF 50%, #FF5FA0 100%);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
}

.abl-auth-login-left-content {
    position: relative;
    z-index: 2;
    max-width: 600px;
}

/* Title & Subtitle */
.abl-auth-login-left-title {
    font-size: 48px;
    font-weight: 700;
    color: var(--abl-btn-primary-text, #ffffff);
    line-height: 1.2;
    margin-bottom: 24px;
    animation: fadeInUp 0.8s ease 0.2s both;
}

.abl-auth-gradient-text {
    color: rgba(255, 255, 255, 0.9);
    display: inline-block;
}

.abl-auth-login-left-subtitle {
    font-size: var(--font-size-lg, 20px);
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.6;
    margin-bottom: var(--spacing-3xl, 48px);
    animation: fadeInUp 0.8s ease 0.4s both;
}

/* Feature Cards */
.abl-auth-feature-cards {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.abl-auth-feature-card {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 24px 28px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: floatUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.abl-auth-card-1, .card-1 { animation-delay: 0.2s; }
.abl-auth-card-2, .card-2 { animation-delay: 0.4s; }
.abl-auth-card-3, .card-3 { animation-delay: 0.6s; }

.abl-auth-feature-card:hover {
    transform: translateY(-8px) scale(1.02);
    background: rgba(255, 255, 255, 0.18);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
    border-color: rgba(255, 255, 255, 0.35);
}

.abl-auth-feature-icon {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.abl-auth-feature-card:hover .abl-auth-feature-icon {
    background: rgba(255, 255, 255, 0.22);
    transform: rotate(5deg) scale(1.1);
}

.abl-auth-feature-text {
    flex: 1;
}

.abl-auth-feature-title {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 6px;
    transition: color 0.3s ease;
}

.abl-auth-feature-desc {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.5;
}

/* Floating Shapes */
.abl-auth-floating-shapes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    opacity: 0.3;
}

.abl-auth-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    animation: floatSlow ease-in-out infinite;
}

.abl-auth-shape-1, .shape-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
    top: -100px;
    right: -100px;
    animation-duration: 25s;
}

.abl-auth-shape-2, .shape-2 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
    bottom: -80px;
    left: -80px;
    animation-duration: 20s;
    animation-direction: reverse;
}

.abl-auth-shape-3, .shape-3 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.12) 0%, transparent 70%);
    top: 40%;
    left: -50px;
    animation-duration: 30s;
}

/* ============================================
   RIGHT PANEL — FORM
   ============================================ */

.abl-auth-login-right {
    flex: 1;
    background: var(--abl-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
}

.abl-auth-login-form-container {
    width: 100%;
    max-width: 440px;
    animation: fadeIn 1s ease;
}

/* Home back-link — subtle styled hyperlink above the form that takes
   the user back to the marketing home page. Replaces the old logo-as-
   back-link which showed the APP_NAME and confused users. */
.abl-auth-home-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 32px;
    padding: 6px 2px;
    font-size: 14px;
    font-weight: 500;
    color: var(--abl-muted, #6B7280);
    text-decoration: none;
    transition: color 0.2s ease, transform 0.2s ease;
}

.abl-auth-home-link::before {
    content: '\2190';
    font-size: 16px;
    transition: transform 0.2s ease;
}

.abl-auth-home-link:hover {
    color: var(--abl-accent);
}

.abl-auth-home-link:hover::before {
    transform: translateX(-3px);
}

/* Form Header */
.abl-auth-login-header {
    margin-bottom: 32px;
}

.abl-auth-login-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--abl-text);
    margin-bottom: 8px;
}

.abl-auth-login-subtitle {
    font-size: 16px;
    color: var(--abl-muted);
    line-height: 1.5;
}

/* Alert Messages */
.abl-auth-login-alert {
    padding: 14px 16px;
    border-radius: var(--radius-lg, 12px);
    margin-bottom: 24px;
    font-size: 14px;
    font-weight: 500;
    animation: slideDown 0.3s ease;
}

.abl-auth-login-alert.success {
    background: rgba(34, 197, 94, 0.1);
    color: #16A34A;
    border: 1px solid #22C55E;
}

.abl-auth-login-alert.error {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.abl-auth-login-alert.info {
    background: var(--abl-highlight-bg);
    color: var(--abl-accent);
    border: 1px solid var(--abl-accent);
}

/* Form */
.abl-auth-login-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.abl-auth-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.abl-auth-form-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--abl-text);
}

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

.abl-auth-input-icon {
    position: absolute;
    left: 16px;
    color: var(--abl-muted);
    pointer-events: none;
}

.abl-auth-form-input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    font-size: 16px;
    color: var(--abl-text);
    background: var(--abl-surface);
    border: 2px solid var(--abl-border);
    border-radius: var(--radius-lg, 12px);
    transition: all 0.2s ease;
    font-family: inherit;
}

.abl-auth-form-input::placeholder {
    color: var(--abl-muted);
}

.abl-auth-form-input:focus {
    outline: none;
    background: var(--abl-surface);
    border-color: var(--abl-accent);
    box-shadow: 0 0 0 4px var(--abl-highlight-bg);
}

.abl-auth-toggle-password {
    position: absolute;
    right: 16px;
    background: none;
    border: none;
    color: var(--abl-muted);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

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

.abl-auth-password-hint {
    font-size: 12px;
    color: var(--abl-muted);
    margin-top: 6px;
}

/* Form Options */
.abl-auth-form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: -8px;
}

.abl-auth-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.abl-auth-checkbox-input {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    cursor: pointer;
    accent-color: var(--abl-accent);
}

.abl-auth-checkbox-text {
    font-size: 14px;
    color: var(--abl-muted);
    user-select: none;
}

.abl-auth-forgot-link {
    font-size: 14px;
    color: var(--abl-accent);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.abl-auth-forgot-link:hover {
    color: var(--abl-accent);
}

/* Submit Button */
.abl-auth-submit-btn {
    width: 100%;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    color: var(--abl-btn-primary-text, #ffffff);
    background: linear-gradient(135deg, #0ED9B4, #7B61FF);
    border: none;
    border-radius: var(--radius-lg, 12px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: var(--abl-card-shadow);
    position: relative;
    overflow: hidden;
}

.abl-auth-submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

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

.abl-auth-submit-btn:hover::before {
    left: 100%;
}

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

.abl-auth-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.abl-auth-btn-arrow {
    transition: transform 0.3s ease;
}

.abl-auth-submit-btn:hover .abl-auth-btn-arrow {
    transform: translateX(4px);
}

.abl-auth-btn-loader {
    display: flex;
    align-items: center;
    justify-content: center;
}

.abl-auth-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Form Footer */
.abl-auth-login-footer {
    margin-top: 32px;
    text-align: center;
}

.abl-auth-footer-text {
    font-size: 14px;
    color: var(--abl-muted);
}

.abl-auth-footer-link {
    color: var(--abl-accent);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.abl-auth-footer-link:hover {
    color: var(--abl-accent);
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

@keyframes floatSlow {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(20px, -20px); }
    50% { transform: translate(-10px, -30px); }
    75% { transform: translate(-20px, 10px); }
}

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

@media (max-width: 1024px) {
    .abl-auth-login-left, .abl-auth-login-right {
        padding: 40px;
    }

    .abl-auth-login-left-title {
        font-size: 36px;
    }

    .abl-auth-login-left-subtitle {
        font-size: 18px;
    }
}

@media (max-width: 768px) {
    body {
        min-height: 100vh;
        height: auto;
    }

    .abl-auth-login-container {
        flex-direction: column;
        min-height: auto;
        overflow-y: auto;
    }

    .abl-auth-login-left {
        min-height: 300px;
        max-height: 40vh;
        padding: 32px;
        flex: none;
    }

    .abl-auth-login-left-title {
        font-size: 28px;
    }

    .abl-auth-login-left-subtitle {
        font-size: 16px;
        margin-bottom: 32px;
    }

    .abl-auth-feature-cards {
        display: none;
    }

    .abl-auth-login-right {
        padding: 32px 24px;
        flex: none;
        min-height: auto;
    }

    .abl-auth-login-title {
        font-size: 28px;
    }

    .abl-auth-shape {
        display: none;
    }
}

@media (max-width: 480px) {
    .abl-auth-login-left {
        padding: 24px;
    }

    .abl-auth-login-right {
        padding: 24px 16px;
    }

    .abl-auth-login-title {
        font-size: 24px;
    }

    .abl-auth-form-input {
        font-size: 16px;
    }
}
