/**
 * EverRich Branding Theme
 * Shared styles for pre-login/branding pages:
 * - login, register, register-success, register-complete
 * - forgot-password, password-reset, password-reset-success
 * - logout-success
 */

:root {
    --header-bg: #1F2937;
    --brand-color: #10B981;
    --brand-color-dark: #059669;
    --accent-color-secondary: #6366F1;
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;
    --border-color: #E5E7EB;
    --input-bg: #F9FAFB;
    --error-color: #DC2626;
    --error-bg: #FEF2F2;
    --error-border: #FECACA;
    --success-color: #16A34A;
    --success-bg: #F0FDF4;
    --success-border: #BBF7D0;
}

* { box-sizing: border-box; }

body.branding-page {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1F2937 0%, #111827 50%, #1F2937 100%);
    font-family: var(--font-family);
    overflow: hidden;
}

body.branding-page::before,
body.branding-page::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    z-index: 0;
}

body.branding-page::before {
    width: 400px;
    height: 400px;
    background: var(--brand-color);
    top: -100px;
    right: -100px;
    animation: float 8s ease-in-out infinite;
}

body.branding-page::after {
    width: 300px;
    height: 300px;
    background: var(--accent-color-secondary);
    bottom: -50px;
    left: -50px;
    animation: float 6s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, 30px); }
}

/* Page Wrapper */
.branding-wrapper {
    width: 100%;
    max-width: 420px;
    padding: 1rem;
    position: relative;
    z-index: 1;
}

.branding-wrapper.narrow {
    max-width: 380px;
}

.branding-wrapper.wide {
    max-width: 480px;
}

/* Card */
.branding-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 0;
    padding: 2.5rem 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.branding-card.centered {
    text-align: center;
    padding: 3rem 2rem;
}

/* Header Section */
.branding-header {
    text-align: center;
    margin-bottom: 2rem;
}

/* Logo */
.branding-logo {
    font-size: 2rem;
    font-weight: 700;
    color: var(--brand-color);
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.branding-logo .brand-accent {
    color: var(--brand-color);
}

/* Motto */
.branding-motto {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 400;
    line-height: 1.5;
    margin-bottom: 0.75rem;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.branding-motto .motto-highlight {
    color: var(--text-primary);
    font-weight: 500;
}

/* Subtitle */
.branding-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* Description Box */
.branding-description {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #F3F4F6;
    border: 1px solid var(--border-color);
    color: #4B5563;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Input Groups */
.branding-input-group {
    position: relative;
    margin-bottom: 1.25rem;
}

.branding-input-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.branding-input-group input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 0;
    font-size: 1rem;
    font-family: inherit;
    background: var(--input-bg);
    transition: all 0.3s ease;
    outline: none;
}

.branding-input-group input.with-icon {
    padding-left: 3rem;
}

.branding-input-group input::placeholder {
    color: var(--text-muted);
}

.branding-input-group input:focus {
    border-color: var(--brand-color);
    background: #FFFFFF;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

.branding-input-group .input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.branding-input-group input:focus + .input-icon {
    color: var(--brand-color);
}

/* Password Input Wrapper */
.password-input-wrapper {
    position: relative;
}

.password-input-wrapper input {
    width: 100%;
    padding: 0.875rem 3rem 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 0;
    font-size: 1rem;
    font-family: inherit;
    background: var(--input-bg);
    transition: all 0.3s ease;
    outline: none;
}

.password-input-wrapper input::placeholder {
    color: var(--text-muted);
}

.password-input-wrapper input:focus {
    border-color: var(--brand-color);
    background: #FFFFFF;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

.toggle-password {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.toggle-password:hover {
    color: var(--brand-color);
}

.password-requirements {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

/* Primary Button */
.btn-primary {
    width: 100%;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--brand-color) 0%, var(--brand-color-dark) 100%);
    color: white;
    border: none;
    border-radius: 0;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 0.5rem;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    display: block;
    text-align: center;
}

.btn-primary::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;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(16, 185, 129, 0.4);
}

.btn-primary:hover::before {
    left: 100%;
}

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

/* Secondary/Outline Button */
.btn-secondary {
    width: 100%;
    padding: 1rem 1.5rem;
    background: transparent;
    color: var(--brand-color);
    border: 2px solid var(--brand-color);
    border-radius: 0;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
    text-decoration: none;
    display: block;
    text-align: center;
}

.btn-secondary:hover {
    background: var(--brand-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(16, 185, 129, 0.4);
}

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

/* Back Button (Muted) */
.btn-back {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: transparent;
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
    border-radius: 0;
    font-size: 1rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 0.75rem;
    text-decoration: none;
    display: block;
    text-align: center;
}

.btn-back:hover {
    background: var(--input-bg);
    border-color: #D1D5DB;
    color: var(--text-primary);
}

/* Inline Button (for centered cards) */
.btn-inline {
    display: inline-block;
    width: auto;
    padding: 1rem 2rem;
}

/* Alerts - Modern Card Style */
.branding-alert {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    text-align: left;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    line-height: 1.5;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.branding-alert svg {
    flex-shrink: 0;
    margin-top: 2px;
}

.branding-alert .alert-content {
    flex: 1;
}

.branding-alert.alert-danger {
    background: linear-gradient(135deg, #FEF2F2 0%, #FEE2E2 100%);
    color: #991B1B;
    border-left: 4px solid var(--error-color);
    border-top: none;
    border-right: none;
    border-bottom: none;
}

.branding-alert.alert-success {
    background: linear-gradient(135deg, #F0FDF4 0%, #DCFCE7 100%);
    color: #166534;
    border-left: 4px solid var(--success-color);
    border-top: none;
    border-right: none;
    border-bottom: none;
}

.branding-alert.alert-info {
    background: linear-gradient(135deg, #F0F9FF 0%, #E0F2FE 100%);
    color: #075985;
    border-left: 4px solid #0EA5E9;
    border-top: none;
    border-right: none;
    border-bottom: none;
}

/* Pending/Processing Alert - Friendly amber/warm style */
.branding-alert.alert-pending {
    background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%);
    color: #92400E;
    border-left: 4px solid #F59E0B;
    border-top: none;
    border-right: none;
    border-bottom: none;
}

.branding-alert.alert-pending svg {
    color: #F59E0B;
}

.branding-alert.alert-info svg {
    color: #0EA5E9;
}

.branding-alert.alert-success svg {
    color: var(--success-color);
}

.branding-alert.alert-danger svg {
    color: var(--error-color);
}

/* Welcome Message Box */
.welcome-message {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--success-bg);
    border: 1px solid var(--success-border);
}

.welcome-message strong {
    color: var(--brand-color);
}

/* Divider */
.branding-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.branding-divider::before,
.branding-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.branding-divider span {
    padding: 0 1rem;
}

/* Footer Text */
.branding-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Links */
.branding-link {
    color: var(--brand-color);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s ease;
}

.branding-link:hover {
    color: var(--brand-color-dark);
    text-decoration: underline;
}

/* Forgot Password Link Container */
.forgot-password-link {
    text-align: right;
    margin-bottom: 1rem;
    margin-top: -0.5rem;
}

/* Success Icon */
.success-icon {
    color: var(--brand-color);
    margin-bottom: 1.5rem;
}

.success-icon svg {
    animation: checkmark 0.5s ease-in-out;
}

@keyframes checkmark {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

/* Success Icon Circle */
.success-icon-circle {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--brand-color) 0%, var(--brand-color-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.success-icon-circle svg {
    color: white;
}

/* Error Card/Section */
.error-card {
    text-align: center;
    padding: 3rem 2rem;
}

.error-icon {
    color: var(--error-color);
    margin-bottom: 1.5rem;
}

.error-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.error-message {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 2rem;
}

/* Title for centered cards */
.branding-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.branding-message {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 2rem;
}

/* Email icon for registration success */
.email-icon {
    display: inline-block;
    margin-bottom: 1.5rem;
}

/* ===============================================
   MOBILE RESPONSIVE STYLES
   Full-screen mobile layout with hero branding
   =============================================== */

@media (max-width: 480px) {
    body.branding-page {
        align-items: stretch;
        overflow: auto;
        background: linear-gradient(135deg, #1F2937 0%, #111827 100%);
    }
    
    body.branding-page::before,
    body.branding-page::after {
        display: none;
    }
    
    .branding-wrapper {
        max-width: 100%;
        padding: 0;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
    }
    
    .branding-card {
        padding: 0;
        border-radius: 0;
        flex: 1;
        display: flex;
        flex-direction: column;
        box-shadow: none;
        background: transparent;
    }
    
    /* Mobile Hero Branding Section */
    .branding-header {
        background: transparent;
        margin: 0;
        padding: 2.5rem 1.75rem 1.5rem 1.75rem;
        text-align: left;
        position: relative;
        overflow: hidden;
    }
    
    .branding-header::before {
        content: '';
        position: absolute;
        width: 200px;
        height: 200px;
        background: var(--brand-color);
        border-radius: 50%;
        filter: blur(80px);
        opacity: 0.25;
        top: -80px;
        right: -60px;
    }
    
    .branding-header::after {
        content: '';
        position: absolute;
        width: 120px;
        height: 120px;
        background: var(--accent-color-secondary);
        border-radius: 50%;
        filter: blur(60px);
        opacity: 0.2;
        bottom: 0;
        left: -40px;
    }
    
    .branding-logo {
        font-size: 2.25rem;
        color: #FFFFFF;
        margin-bottom: 1.25rem;
        position: relative;
        z-index: 1;
        letter-spacing: -0.5px;
        font-weight: 700;
    }
    
    .branding-logo .brand-accent {
        color: var(--brand-color);
    }
    
    .branding-motto {
        color: rgba(255, 255, 255, 0.85);
        font-size: 1.1rem;
        line-height: 1.6;
        position: relative;
        z-index: 1;
        margin: 0 0 0.5rem 0;
        font-weight: 400;
        letter-spacing: -0.2px;
        max-width: none;
    }
    
    .branding-motto .motto-highlight {
        color: var(--brand-color);
        font-weight: 500;
    }
    
    .branding-subtitle {
        color: rgba(255, 255, 255, 0.7);
        position: relative;
        z-index: 1;
    }
    
    /* Hide desktop subtitle on mobile if needed */
    .branding-header .branding-subtitle.hide-mobile {
        display: none;
    }
    
    /* Mobile Form Section */
    .mobile-form-section {
        padding: 2rem 1.5rem;
        flex: 1;
        display: flex;
        flex-direction: column;
    }
    
    .branding-alert {
        margin-bottom: 1.25rem;
    }
    
    .branding-input-group {
        margin-bottom: 1.25rem;
    }
    
    .branding-input-group input,
    .password-input-wrapper input {
        padding-top: 1.1rem;
        padding-bottom: 1.1rem;
        font-size: 1rem;
        background: rgba(255, 255, 255, 0.95);
    }
    
    .branding-input-group input.with-icon {
        padding-left: 3rem;
    }
    
    .btn-primary {
        padding: 1.1rem;
        font-size: 1.05rem;
        margin-top: 0.5rem;
    }
    
    .btn-secondary {
        padding: 1rem;
        background: transparent;
        border-color: var(--brand-color);
        color: var(--brand-color);
    }
    
    .btn-secondary:hover {
        background: var(--brand-color);
        color: white;
    }
    
    .branding-divider {
        margin: 1.25rem 0;
        color: rgba(255, 255, 255, 0.5);
    }
    
    .branding-divider::before,
    .branding-divider::after {
        border-color: rgba(255, 255, 255, 0.2);
    }
    
    .branding-footer {
        margin-top: auto;
        padding-top: 1.5rem;
        padding-bottom: 1rem;
        color: rgba(255, 255, 255, 0.5);
    }
    
    .forgot-password-link a,
    .branding-link {
        color: var(--brand-color);
    }
    
    /* For centered success/error cards on mobile */
    .branding-card.centered {
        padding: 0;
        text-align: left;
    }
    
    .branding-card.centered .branding-header {
        text-align: left;
    }
    
    .branding-card.centered .mobile-form-section {
        text-align: center;
    }
    
    .branding-card.centered .branding-title,
    .branding-card.centered .branding-message {
        color: rgba(255, 255, 255, 0.9);
    }
    
    .branding-card.centered .success-icon,
    .branding-card.centered .success-icon-circle,
    .branding-card.centered .email-icon,
    .branding-card.centered .error-icon {
        margin-left: auto;
        margin-right: auto;
    }
    
    .branding-card.centered .success-icon svg,
    .branding-card.centered .error-icon svg {
        color: var(--brand-color);
    }
    
    .branding-card.centered .error-icon svg {
        color: var(--error-color);
    }
    
    .branding-card.centered .btn-primary,
    .branding-card.centered .btn-secondary {
        width: 100%;
    }
    
    /* Success page specific mobile styles */
    .email-icon svg {
        stroke: var(--brand-color);
    }
    
    .branding-message strong {
        color: var(--brand-color);
    }
    
    /* Description box on mobile */
    .branding-description {
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.2);
        color: rgba(255, 255, 255, 0.8);
    }
    
    /* Welcome message on mobile */
    .welcome-message {
        background: rgba(16, 185, 129, 0.15);
        border-color: rgba(16, 185, 129, 0.3);
        color: rgba(255, 255, 255, 0.9);
    }
    
    .welcome-message strong {
        color: var(--brand-color);
    }
}