/**
 * AUTH STYLES - Split Screen Design
 *
 * Minimalistyczny design z podziałem 50/50
 * Kolorystyka: Emerald Green Accent (#10b981) - zgodnie z custom.css
 *
 * @package GrantOMat
 * @version 3.0
 */

/* =============================================================================
   CSS VARIABLES - Zgodne z custom.css
   ============================================================================= */

:root {
    /* Accent Colors - używa zmiennych z branding-variables.css */
    --auth-accent-700: var(--color-accent-700, #047857);
    --auth-accent-600: var(--color-accent-600, #059669);
    --auth-accent-500: var(--color-accent-500, #10b981);
    --auth-accent-400: var(--color-accent-400, #34d399);
    --auth-accent-100: var(--color-accent-100, #d1fae5);
    --auth-accent-50:  var(--color-accent-50, #ecfdf5);

    /* Primary/Neutral Colors */
    --auth-primary-900: #111827;
    --auth-primary-800: #1f2937;
    --auth-primary-700: #374151;
    --auth-primary-600: #4b5563;
    --auth-primary-500: #6b7280;
    --auth-primary-400: #9ca3af;
    --auth-primary-300: #d1d5db;
    --auth-primary-200: #e5e7eb;
    --auth-primary-100: #f3f4f6;
    --auth-primary-50:  #f9fafb;

    /* Semantic Colors */
    --auth-success-600: #16a34a;
    --auth-success-100: #dcfce7;
    --auth-danger-600: #dc2626;
    --auth-danger-100: #fee2e2;
    --auth-info-600: #0284c7;
    --auth-info-100: #e0f2fe;

    /* Shadows */
    --auth-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --auth-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --auth-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --auth-shadow-accent: var(--shadow-accent, 0 4px 14px rgba(16, 185, 129, 0.25));

    /* Border Radius */
    --auth-radius-md: 0.5rem;
    --auth-radius-lg: 0.75rem;
    --auth-radius-xl: 1rem;
    --auth-radius-2xl: 1.25rem;

    /* Transitions */
    --auth-transition-fast: 150ms ease;
    --auth-transition-normal: 200ms ease;
}

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

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

body {
    font-family: 'Helvetica Neue', Helvetica, Arial, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--auth-primary-900);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* =====================================================
   LAYOUT - Split Screen
   ===================================================== */

.auth-body {
    min-height: 100vh;
    display: flex;
    overflow: hidden;
    background: var(--auth-primary-50);
}

/* Lewa strona - Formularz */
.auth-left {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--auth-primary-50);
    padding: 40px;
    position: relative;
    overflow-y: auto;
}

/* Prawa strona - Zdjęcie */
.auth-right {
    flex: 1;
    background: var(--auth-primary-50);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 50px;
}

.auth-image {
    width: 92%;
    max-width: 650px;
    height: auto;
    max-height: 85vh;
    object-fit: cover;
    object-position: center;
    border-radius: var(--auth-radius-2xl);
    box-shadow: var(--auth-shadow-lg);
}

/* =====================================================
   FORM CONTAINER
   ===================================================== */

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

/* Logo Section */
.auth-logo-section {
    text-align: center;
    margin-bottom: 40px;
}

.auth-logo-link {
    display: inline-block;
    text-decoration: none;
}

.auth-logo {
    height: 60px;
    width: auto;
    margin-bottom: 12px;
}

.auth-logo-large {
    height: 120px;
    max-width: 400px;
    margin-bottom: 0;
}

.auth-system-name {
    color: var(--auth-primary-900);
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

/* =====================================================
   AUTH CARD
   ===================================================== */

.auth-card {
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}

.auth-card-header {
    padding: 0 0 32px 0;
    text-align: left;
}

.auth-card-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--auth-primary-900);
    margin-bottom: 8px;
    letter-spacing: -0.025em;
}

.auth-card-subtitle {
    font-size: 1rem;
    color: var(--auth-primary-500);
    margin-bottom: 0;
    font-weight: 400;
}

.auth-card-body {
    padding: 0;
}

/* =====================================================
   SOCIAL LOGIN BUTTONS
   ===================================================== */

.social-login-section {
    margin-top: 24px;
    margin-bottom: 0;
}

.btn-social {
    width: 100%;
    height: 52px;
    border: 1px solid var(--auth-primary-200);
    border-radius: var(--auth-radius-lg);
    background: #ffffff;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--auth-primary-900);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all var(--auth-transition-normal);
    cursor: pointer;
    margin-bottom: 12px;
}

.btn-social:hover {
    border-color: var(--auth-accent-500);
    background: var(--auth-accent-50);
    transform: translateY(-1px);
    box-shadow: var(--auth-shadow-md);
}

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

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

.btn-social.google:hover {
    border-color: #4285F4;
    background: #f0f7ff;
}

.btn-social.facebook:hover {
    border-color: #1877F2;
    background: #f0f5ff;
}

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

.auth-divider {
    position: relative;
    text-align: center;
    margin: 32px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: calc(50% - 30px);
    height: 1px;
    background: var(--auth-primary-200);
}

.auth-divider::before {
    left: 0;
}

.auth-divider::after {
    right: 0;
}

.auth-divider span {
    background: var(--auth-primary-50);
    padding: 0 20px;
    color: var(--auth-primary-400);
    font-size: 0.875rem;
    font-weight: 500;
}

/* =====================================================
   FORM ELEMENTS
   ===================================================== */

.form-label {
    font-weight: 600;
    color: var(--auth-primary-900);
    font-size: 0.9rem;
    margin-bottom: 8px;
    display: block;
}

.form-control {
    width: 100%;
    height: 52px;
    border: 1px solid var(--auth-primary-200);
    border-radius: var(--auth-radius-lg);
    padding: 14px 16px;
    font-size: 1rem;
    transition: all var(--auth-transition-normal);
    color: var(--auth-primary-900);
    background: #ffffff;
}

.form-control::placeholder {
    color: var(--auth-primary-400);
}

.form-control:focus {
    border-color: var(--auth-accent-500);
    outline: none;
    box-shadow: 0 0 0 4px var(--bg-accent-subtle, rgba(16, 185, 129, 0.1));
}

.form-control.is-invalid {
    border-color: var(--auth-danger-600);
}

/* Input Group */
.input-group {
    position: relative;
    display: flex;
    align-items: stretch;
}

.input-group-text {
    display: flex;
    align-items: center;
    padding: 0 16px;
    background: var(--auth-primary-100);
    border: 1px solid var(--auth-primary-200);
    border-right: none;
    border-radius: var(--auth-radius-lg) 0 0 var(--auth-radius-lg);
    color: var(--auth-primary-500);
}

.input-group .form-control {
    border-left: none;
    border-radius: 0 var(--auth-radius-lg) var(--auth-radius-lg) 0;
}

.input-group:focus-within .input-group-text {
    border-color: var(--auth-accent-500);
    background: var(--auth-accent-50);
    color: var(--auth-accent-600);
}

.input-group:focus-within .form-control {
    border-color: var(--auth-accent-500);
}

/* Password Toggle Button */
.btn-outline-secondary {
    border: 1px solid var(--auth-primary-200);
    border-left: none;
    border-radius: 0 var(--auth-radius-lg) var(--auth-radius-lg) 0;
    background: var(--auth-primary-100);
    color: var(--auth-primary-500);
    padding: 0 16px;
    cursor: pointer;
    transition: all var(--auth-transition-normal);
}

.btn-outline-secondary:hover {
    background: var(--auth-primary-200);
    color: var(--auth-primary-700);
}

.input-group:focus-within .btn-outline-secondary {
    border-color: var(--auth-accent-500);
    background: var(--auth-accent-50);
}

/* =====================================================
   FORM EXTRAS (Remember me, Forgot password)
   ===================================================== */

.form-extras {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-check-input {
    width: 18px;
    height: 18px;
    border: 1px solid var(--auth-primary-300);
    border-radius: 4px;
    cursor: pointer;
    accent-color: var(--auth-accent-500);
}

.form-check-input:checked {
    background-color: var(--auth-accent-500);
    border-color: var(--auth-accent-500);
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px var(--border-glass, rgba(16, 185, 129, 0.15));
}

.form-check-label {
    font-size: 0.9rem;
    color: var(--auth-primary-600);
    cursor: pointer;
    margin: 0;
}

.auth-link {
    color: var(--auth-accent-600);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: color var(--auth-transition-fast);
}

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

/* =====================================================
   BUTTONS
   ===================================================== */

.btn {
    height: 52px;
    border-radius: var(--auth-radius-lg);
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: all var(--auth-transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--auth-accent-500) 0%, var(--auth-accent-600) 100%);
    color: #ffffff;
    width: 100%;
    position: relative;
    overflow: hidden;
    box-shadow: var(--auth-shadow-accent);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--auth-accent-600) 0%, var(--auth-accent-700) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-accent-hover, 0 8px 20px rgba(16, 185, 129, 0.35));
}

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

/* =====================================================
   REGISTER LINK
   ===================================================== */

.auth-register {
    text-align: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--auth-primary-200);
}

.auth-register p {
    color: var(--auth-primary-600);
    font-size: 0.95rem;
    margin: 0;
}

.auth-register a {
    color: var(--auth-accent-600);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--auth-transition-fast);
}

.auth-register a:hover {
    color: var(--auth-accent-700);
}

/* =====================================================
   ALERTS
   ===================================================== */

.alert {
    border-radius: var(--auth-radius-lg);
    border: none;
    padding: 16px;
    font-size: 0.95rem;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 4px solid;
}

.alert-danger {
    background: var(--auth-danger-100);
    color: var(--auth-danger-600);
    border-left-color: var(--auth-danger-600);
}

.alert-success {
    background: var(--auth-success-100);
    color: var(--auth-success-600);
    border-left-color: var(--auth-success-600);
}

.alert-info {
    background: var(--auth-info-100);
    color: var(--auth-info-600);
    border-left-color: var(--auth-info-600);
}

.btn-close {
    margin-left: auto;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: inherit;
    opacity: 0.5;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
}

.btn-close:hover {
    opacity: 1;
}

/* =====================================================
   VALIDATION
   ===================================================== */

.invalid-feedback {
    color: var(--auth-danger-600);
    font-size: 0.85rem;
    margin-top: 6px;
    display: none;
}

.was-validated .form-control:invalid ~ .invalid-feedback {
    display: block;
}

.was-validated .form-control:invalid {
    border-color: var(--auth-danger-600);
}

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

/* Tablets and smaller laptops (768px - 1200px) */
@media (max-width: 1200px) {
    .auth-left {
        padding: 30px;
    }

    .auth-right {
        padding: 30px;
    }

    .auth-container {
        max-width: 380px;
    }

    .auth-logo {
        height: 50px;
    }

    .auth-logo-section {
        margin-bottom: 30px;
    }

    .auth-system-name {
        font-size: 1.25rem;
    }

    .auth-card-title {
        font-size: 1.75rem;
    }

    .form-control,
    .btn,
    .btn-social {
        height: 48px;
        font-size: 0.95rem;
    }

    .auth-image {
        width: 90%;
        max-width: 500px;
        max-height: 80vh;
    }
}

@media (max-width: 992px) {
    .auth-body {
        flex-direction: column;
    }

    .auth-right {
        display: none;
    }

    .auth-left {
        flex: 1;
        min-height: 100vh;
        padding: 40px 20px;
    }

    .auth-container {
        max-width: 450px;
    }
}

/* Small tablets (600px - 768px) */
@media (max-width: 768px) {
    .auth-left {
        padding: 30px 20px;
    }

    .auth-container {
        max-width: 100%;
        padding: 0 10px;
    }

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

    .auth-card-header {
        padding: 0 0 24px 0;
    }
}

@media (max-width: 576px) {
    .auth-left {
        padding: 24px 16px;
    }

    .auth-container {
        max-width: 100%;
    }

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

    .auth-logo-section {
        margin-bottom: 24px;
    }

    .auth-logo {
        height: 45px;
    }

    .auth-system-name {
        font-size: 1.1rem;
    }

    .form-control,
    .btn,
    .btn-social {
        height: 46px;
        font-size: 0.9rem;
    }

    .form-label {
        font-size: 0.85rem;
    }

    .form-extras {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .btn-social {
        font-size: 0.9rem;
        padding: 0 12px;
    }

    .auth-divider {
        margin: 24px 0;
    }
}

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

.btn:focus,
.form-control:focus,
.form-check-input:focus,
.btn-social:focus {
    outline: 2px solid var(--auth-accent-500);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* =====================================================
   DEVELOPMENT MODE
   ===================================================== */

.auth-card-footer {
    margin-top: 24px;
    padding: 16px;
    background: var(--auth-primary-100);
    border-radius: var(--auth-radius-lg);
    border: 1px solid var(--auth-primary-200);
}

.auth-card-footer .alert {
    margin-bottom: 0;
    font-size: 0.85rem;
}
