/* ============================================
   Auth Pages Styles - Appeals Doctor
   Split-Panel Layout for Login, Signup, Password Reset
   Uses design-system.css variables
   ============================================ */

/* CSS Reset for Auth Pages */
.auth-page * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.auth-page html {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
}

.auth-page {
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: var(--color-bg-page);
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
}

/* Main Container */
.auth-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
    background-color: var(--color-bg-page);
    padding: var(--space-3xl);
    gap: var(--space-3xl);
    position: relative;
}

/* ============================================
   LEFT PANEL - Dark Blue Promotional Section
   ============================================ */

.left-panel {
    flex: 0 0 674px;
    background-color: var(--color-primary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-6xl) var(--space-5xl);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--space-4xl);
}

.left-panel-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-4xl);
}

/* Promotional Content */
.promo-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-3xl);
}

.promo-text {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    color: var(--color-text-inverse);
}

.promo-title {
    font-family: var(--font-display);
    font-size: var(--font-size-display-lg);
    font-weight: var(--font-weight-medium);
    line-height: var(--line-height-display-lg);
    letter-spacing: 0;
    color: var(--color-text-inverse);
    margin: 0;
    max-width: 531px;
}

.promo-description {
    font-size: var(--font-size-h4);
    font-weight: var(--font-weight-regular);
    line-height: 1.4;
    color: var(--color-text-inverse);
    margin: 0;
}

/* Feature List */
.feature-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.feature-item {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    color: var(--color-text-inverse);
}

.feature-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.feature-item span {
    font-size: var(--font-size-h6);
    font-weight: var(--font-weight-regular);
    line-height: normal;
    color: var(--color-text-inverse);
}

/* Dashboard Preview Image */
.dashboard-preview {
    width: 100%;
    max-width: 574px;
    height: auto;
    border-radius: var(--radius-md);
    overflow: hidden;
    flex-shrink: 0;
}

.dashboard-preview img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    border-radius: var(--radius-md);
    max-height: 450px;
}

/* ============================================
   RIGHT PANEL - Form Section
   ============================================ */

.right-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4xl);
}

.right-panel-content {
    width: 100%;
    max-width: 576px;
    display: flex;
    flex-direction: column;
    gap: var(--space-4xl);
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
}

.logo-img {
    height: auto;
    width: 200px;
    max-width: 100%;
}

/* Heading Section */
.heading-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.main-heading {
    font-family: var(--font-display);
    font-size: var(--font-size-display-sm);
    font-weight: var(--font-weight-medium);
    line-height: var(--line-height-display-sm);
    letter-spacing: 0;
    color: var(--color-text-primary);
    margin: 0;
}

.sub-heading {
    font-size: var(--font-size-h5);
    font-weight: var(--font-weight-regular);
    line-height: normal;
    color: var(--color-text-secondary);
    margin: 0;
}

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

.auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-4xl);
}

.form-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

/* Input Group */
.input-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    position: relative;
}

/* Override design system input-label for auth pages if needed */
.auth-form .input-label {
    display: block;
    font-family: var(--font-body);
    font-size: var(--font-size-body);
    font-weight: var(--font-weight-medium);
    line-height: 12px;
    color: var(--color-text-primary);
    padding-bottom: var(--space-xs);
}

/* Override design system text-input for auth pages if needed */
.auth-form .text-input {
    width: 100%;
    height: 48px;
    padding: var(--space-sm) var(--space-md);
    background-color: var(--color-bg-input);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: var(--font-size-small);
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-small);
    color: var(--color-text-primary);
    transition: border-color var(--transition-normal), background-color var(--transition-normal);
}

.auth-form .text-input::placeholder {
    color: var(--color-text-secondary);
}

.auth-form .text-input:focus {
    outline: none;
    border-color: var(--color-primary);
    background-color: var(--color-text-inverse);
}

.auth-form .text-input:hover {
    border-color: var(--color-primary);
}

/* Forgot Password Link */
.forgot-password {
    font-size: var(--font-size-body);
    font-weight: var(--font-weight-medium);
    line-height: normal;
    color: var(--color-text-primary);
    text-decoration: none;
    text-align: right;
    margin-top: var(--space-sm);
    transition: color var(--transition-normal);
}

.forgot-password:hover {
    color: var(--color-accent);
    text-decoration: underline;
}

/* Error Message */
.error-message {
    padding: var(--space-md) var(--space-lg);
    background-color: var(--color-error-bg);
    border: 1px solid var(--color-error-border);
    border-radius: var(--radius-sm);
    color: var(--color-error);
    font-size: var(--font-size-body);
    line-height: var(--line-height-body);
}

.error-message p {
    margin: 0;
}

/* Sign In/Up Button */
.btn-submit {
    width: 100%;
    height: 60px;
    padding: 10px;
    background-color: var(--color-primary);
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: var(--font-size-body);
    font-weight: var(--font-weight-medium);
    line-height: normal;
    color: var(--color-text-inverse);
    cursor: pointer;
    transition: background-color var(--transition-slow), 
                transform var(--transition-slow), 
                box-shadow var(--transition-slow);
}

.btn-submit:hover {
    background-color: var(--color-primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-submit:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

/* Alternate Action Text (Sign up / Sign in link) */
.alternate-action {
    font-size: var(--font-size-body);
    font-weight: var(--font-weight-regular);
    line-height: normal;
    color: var(--color-text-primary);
    text-align: center;
    margin: 0;
}

.alternate-link {
    font-family: var(--font-display);
    font-size: var(--font-size-body);
    font-weight: var(--font-weight-semibold);
    line-height: 20px;
    letter-spacing: 0.1px;
    color: var(--color-accent);
    text-decoration: none;
    transition: color var(--transition-normal);
}

.alternate-link:hover {
    color: var(--color-accent-hover);
    text-decoration: underline;
}

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

.divider {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.divider-line {
    flex: 1;
    height: 1px;
    background-color: var(--color-border-medium);
}

.divider-text {
    font-size: var(--font-size-small);
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-small);
    color: var(--color-text-secondary);
    text-align: center;
}

/* Alternate Action Text (Sign up / Sign in link) */
.auth-alternate-text {
    font-size: var(--font-size-body);
    font-weight: var(--font-weight-regular);
    line-height: normal;
    color: var(--color-text-primary);
    text-align: center;
    margin: 0;
}

.auth-link {
    font-family: var(--font-display);
    font-size: var(--font-size-body);
    font-weight: var(--font-weight-semibold);
    line-height: 20px;
    letter-spacing: 0.1px;
    color: var(--color-accent);
    text-decoration: none;
    transition: color var(--transition-normal);
}

.auth-link:hover {
    color: var(--color-accent-hover);
    text-decoration: underline;
}

/* ============================================
   AUTH0/SOCIAL BUTTON
   ============================================ */

.btn-social,
.btn-auth0 {
    width: 100%;
    height: 56px;
    padding: 10px;
    background-color: transparent;
    border: 1px solid var(--color-primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    font-family: var(--font-body);
    font-size: var(--font-size-body);
    font-weight: var(--font-weight-medium);
    line-height: normal;
    color: var(--color-primary);
    cursor: pointer;
    transition: background-color var(--transition-slow), 
                color var(--transition-slow),
                transform var(--transition-slow), 
                box-shadow var(--transition-slow);
}

.btn-social:hover,
.btn-auth0:hover {
    background-color: var(--color-primary);
    color: var(--color-text-inverse);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-social:hover .social-icon path,
.btn-auth0:hover .auth0-icon path {
    fill: var(--color-text-inverse);
}

.btn-social:active,
.btn-auth0:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.social-icon,
.auth0-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.social-icon path,
.auth0-icon path {
    transition: fill var(--transition-slow);
}

/* Input Error Message */
.input-error {
    color: var(--color-error);
    font-size: var(--font-size-small);
    margin-top: var(--space-xs);
    display: block;
}

/* Back Link */
.back-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    font-family: var(--font-display);
    font-size: var(--font-size-body);
    font-weight: var(--font-weight-semibold);
    line-height: 20px;
    letter-spacing: 0.1px;
    color: var(--color-text-primary);
    text-decoration: none;
    transition: color var(--transition-normal);
}

.back-link:hover {
    color: var(--color-accent);
}

.back-link svg {
    width: 24px;
    height: 24px;
}

/* ============================================
   SUCCESS / CONFIRMATION PANEL
   ============================================ */

.success-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.reset-email-icon {
    width: 80px;
    height: 80px;
    background-color: var(--color-info-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-2xl);
}

.reset-email-icon svg {
    width: 36px;
    height: 36px;
    color: var(--color-info);
}

.reset-email-description {
    font-size: var(--font-size-h6);
    font-weight: var(--font-weight-regular);
    line-height: 1.6;
    color: var(--color-text-secondary);
    text-align: center;
    margin: 0 0 var(--space-4xl);
    max-width: 420px;
}

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

@media (max-width: 1400px) {
    .auth-container {
        padding: var(--space-2xl);
        gap: var(--space-2xl);
    }
    
    .left-panel {
        flex: 0 0 500px;
        padding: var(--space-5xl) var(--space-4xl);
    }
    
    .promo-title {
        font-size: var(--font-size-display-sm);
        line-height: 42px;
    }
    
    .promo-description {
        font-size: var(--font-size-h5);
    }
}

/* Tablet and Below - Stack Vertically (Form First on Mobile) */
@media (max-width: 1200px) {
    .auth-page {
        height: auto;
        min-height: 100vh;
        overflow-x: hidden;
        overflow-y: auto;
    }
    
    .auth-container {
        flex-direction: column-reverse;
        height: auto;
        min-height: auto;
        padding: 0;
        gap: 0;
        overflow: visible;
    }
    
    .left-panel {
        flex: none;
        width: 100%;
        min-height: auto;
        height: auto;
        padding: var(--space-5xl) var(--space-4xl);
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        justify-content: flex-start;
    }
    
    .right-panel {
        flex: none;
        width: 100%;
        height: auto;
        padding: var(--space-4xl) var(--space-xl) var(--space-5xl);
    }
    
    .right-panel-content {
        max-width: 500px;
        margin: 0 auto;
    }
    
    .dashboard-preview {
        max-width: 100%;
    }
    
    .left-panel-content {
        gap: var(--space-3xl);
    }
}

/* Mobile Optimization */
@media (max-width: 768px) {
    .auth-page {
        overflow-y: auto;
        overflow-x: hidden;
    }
    
    .auth-container {
        padding: 0;
        gap: 0;
        overflow: visible;
    }
    
    .left-panel {
        padding: var(--space-4xl) var(--space-2xl);
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }
    
    .left-panel-content {
        gap: var(--space-2xl);
    }
    
    .promo-title {
        font-size: 28px;
        line-height: 34px;
    }
    
    .promo-description {
        font-size: var(--font-size-h6);
    }
    
    .promo-content {
        gap: var(--space-2xl);
    }
    
    .feature-list {
        gap: var(--space-sm);
    }
    
    .feature-item span {
        font-size: var(--font-size-body);
    }
    
    .main-heading {
        font-size: 28px;
        line-height: 34px;
    }
    
    .sub-heading {
        font-size: var(--font-size-h6);
    }
    
    .right-panel {
        padding: var(--space-3xl) var(--space-xl) 48px;
    }
    
    .right-panel-content {
        gap: var(--space-3xl);
    }
    
    .logo-img {
        width: 160px;
    }
    
    .dashboard-preview {
        max-height: 300px;
        overflow: hidden;
    }
    
    .dashboard-preview img {
        object-fit: contain;
    }
}

/* Small Mobile Devices */
@media (max-width: 480px) {
    .auth-page {
        overflow-y: auto !important;
        overflow-x: hidden;
        height: auto;
    }
    
    .left-panel {
        padding: var(--space-3xl) var(--space-xl);
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }
    
    .promo-title {
        font-size: 24px;
        line-height: 30px;
    }
    
    .promo-description {
        font-size: var(--font-size-body);
    }
    
    .feature-item {
        gap: var(--space-sm);
    }
    
    .feature-item span {
        font-size: 13px;
    }
    
    .main-heading {
        font-size: 24px;
        line-height: 30px;
    }
    
    .sub-heading {
        font-size: var(--font-size-body);
    }
    
    .right-panel {
        padding: var(--space-2xl) var(--space-lg) var(--space-4xl);
    }
    
    .right-panel-content {
        gap: 28px;
    }
    
    .logo-img {
        width: 140px;
    }
    
    .heading-section {
        gap: 6px;
    }
    
    .auth-form {
        gap: var(--space-3xl);
    }
    
    .form-section {
        gap: var(--space-lg);
    }
    
    .btn-submit,
    .btn-social {
        height: 48px;
        font-size: var(--font-size-body);
    }
    
    .dashboard-preview {
        max-height: 200px;
    }
}

/* Very Small Devices */
@media (max-width: 375px) {
    .auth-page {
        overflow-y: auto !important;
        overflow-x: hidden !important;
    }
    
    .left-panel {
        padding: var(--space-2xl) var(--space-lg);
    }
    
    .promo-title {
        font-size: 20px;
        line-height: 26px;
    }
    
    .promo-description {
        font-size: 13px;
    }
    
    .feature-item span {
        font-size: var(--font-size-small);
    }
    
    .main-heading {
        font-size: 22px;
        line-height: 28px;
    }
    
    .dashboard-preview {
        max-height: 150px;
    }
    
    .logo-img {
        width: 120px;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

/* Focus visible for keyboard navigation */
.auth-form .text-input:focus-visible,
.btn-submit:focus-visible,
.btn-social:focus-visible,
.forgot-password:focus-visible,
.alternate-link:focus-visible,
.back-link:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* ============================================
   FORM VALIDATION STATES (for signup)
   ============================================ */

.text-input.is-invalid {
    border-color: var(--color-error);
}

.text-danger {
    color: var(--color-error);
    font-size: var(--font-size-small);
    margin-top: var(--space-xs);
}

.text-success {
    color: var(--color-success);
}

/* Password Requirements List */
.password-requirements {
    margin-top: var(--space-md);
}

.password-requirements ul {
    list-style: none;
    padding-left: var(--space-sm);
    margin: var(--space-sm) 0 0;
}

.password-requirements li {
    font-size: var(--font-size-small);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-xs);
}

.password-requirements li.requirement-met {
    color: var(--color-success);
}

.password-requirements li.requirement-met::before {
    content: '✓ ';
}

.password-feedback {
    font-size: var(--font-size-small);
    margin-top: var(--space-sm);
}

.password-match {
    color: var(--color-success);
}

.password-mismatch {
    color: var(--color-error);
}

/* Checkbox styling */
.form-check {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    cursor: pointer;
}

.form-check-input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: var(--color-primary);
}

.form-check-label {
    font-size: var(--font-size-body);
    color: var(--color-text-primary);
    line-height: var(--line-height-body);
}

.form-check-label a {
    color: var(--color-accent);
    text-decoration: none;
}

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

/* Input group with toggle (for password visibility) */
.input-group-flat {
    position: relative;
    display: flex;
}

.input-group-flat .text-input {
    flex: 1;
    padding-right: 48px;
}

.input-group-flat .input-group-text {
    position: absolute;
    right: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-secondary);
    padding: var(--space-xs);
}

.input-group-flat .input-group-text:hover {
    color: var(--color-text-primary);
}

.input-group-flat .icon {
    width: 20px;
    height: 20px;
}

