/* =====================================
   LOGIN PAGE STYLES
   ===================================== */

/* =====================================
   ACCESSIBILITY HELPERS
===================================== */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Honeypot field - Bot protection (invisible) */
.honeypot-field {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 10px;
    z-index: 10000;
    background: #000;
    color: #fff;
    padding: 10px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
}

.skip-link:focus,
.skip-link:focus-visible {
    left: 10px;
}

/* =====================================
   FOCUS INDICATORS (WCAG)
===================================== */
:focus-visible {
    outline: 3px solid #7e22ce;
    outline-offset: 2px;
    border-radius: 8px;
}

.btn-login:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
    box-shadow: 0 0 0 6px rgba(126, 34, 206, 0.5);
}

.form-control:focus-visible {
    border-color: #7e22ce;
    box-shadow: 0 0 0 4px rgba(126, 34, 206, 0.2);
    outline: none;
}

/* =====================================
   REDUCED MOTION SUPPORT
===================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
    body::before {
        animation: none !important;
    }
}

/* =====================================
   BASE STYLES
===================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #7e22ce 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Animated background particles (GPU accelerated) */
body::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(138, 43, 226, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(30, 60, 114, 0.3) 0%, transparent 50%);
    animation: drift 20s ease-in-out infinite;
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
}

@keyframes drift {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(30px, -30px); }
    66% { transform: translate(-20px, 20px); }
}

.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    z-index: 1;
    width: 100%;
    max-width: 900px;
    padding: 20px;
    min-height: 600px; /* CLS prevention */
}

/* =====================================
   LOGO SECTION
===================================== */
.logo-section {
    background: rgba(255, 255, 255, 0.98);
    padding: 60px 40px;
    border-radius: 20px 0 0 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: -10px 0 30px rgba(0,0,0,0.1);
    min-width: 300px;
}

.logo-section img {
    max-width: 200px;
    width: 200px;
    height: auto;
    aspect-ratio: 16 / 9; /* CLS prevention */
    margin-bottom: 20px;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}

.logo-section h2 {
    color: #1e3c72;
    font-size: 20px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 10px;
}

.logo-section p {
    color: #6b7280;
    font-size: 14px;
    text-align: center;
    line-height: 1.6;
}

/* =====================================
   LOGIN CARD
===================================== */
.login-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-radius: 0 20px 20px 0;
    box-shadow: 10px 0 30px rgba(0,0,0,0.1);
    padding: 40px 50px;
    width: 100%;
    max-width: 420px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    color: #1e3c72; /* Fallback for accessibility */
    background: linear-gradient(135deg, #1e3c72 0%, #7e22ce 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

/* High contrast mode fallback */
@media (forced-colors: active) {
    .login-header h1 {
        -webkit-text-fill-color: CanvasText !important;
        color: CanvasText !important;
        background: none !important;
    }
}

@media print {
    .login-header h1 {
        -webkit-text-fill-color: #1e3c72 !important;
        color: #1e3c72 !important;
        background: none !important;
    }
}

.login-header p {
    color: #6b7280;
    font-size: 15px;
    font-weight: 500;
}

/* =====================================
   FORM STYLES
===================================== */
.form-group {
    margin-bottom: 24px;
    position: relative;
}

.form-label {
    color: #374151;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
}

.form-control {
    height: 50px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: #f9fafb;
    width: 100%;
}

.form-control:focus {
    border-color: #7e22ce;
    box-shadow: 0 0 0 4px rgba(126, 34, 206, 0.2);
    background: white;
    outline: none;
}

.form-control:hover {
    border-color: #d1d5db;
    background: white;
}

.form-control::placeholder {
    color: #6b7280; /* WCAG AA contrast: 4.5:1 */
}

.form-control[aria-invalid="true"] {
    border-color: #dc2626;
}

/* Password toggle button */
.password-wrapper {
    position: relative;
}

.password-wrapper .form-control {
    padding-right: 48px;
}

.password-toggle {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    padding: 8px 12px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    border-radius: 8px;
    z-index: 10;
    pointer-events: auto;
}

.password-toggle:hover {
    color: #7e22ce;
    background: rgba(126, 34, 206, 0.05);
}

.password-toggle:focus-visible {
    outline: 2px solid #7e22ce;
    outline-offset: 2px;
}

/* =====================================
   BUTTON STYLES
===================================== */
.btn-login {
    background: linear-gradient(135deg, #1e3c72 0%, #7e22ce 100%);
    border: none;
    padding: 14px 20px;
    font-weight: 600;
    font-size: 16px;
    width: 100%;
    min-height: 48px;
    border-radius: 12px;
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(126, 34, 206, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(126, 34, 206, 0.4);
    background: linear-gradient(135deg, #2a5298 0%, #9333ea 100%);
}

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

/* =====================================
   FOOTER STYLES
===================================== */
.login-footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.help-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.help-link {
    color: #6b21a8; /* WCAG AA contrast: 4.6:1 */
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 8px 0;
}

.help-link:hover {
    color: #581c87;
    gap: 12px;
}

.help-link:focus-visible {
    outline: 2px solid #7e22ce;
    outline-offset: 2px;
    border-radius: 4px;
}

.help-link i {
    font-size: 12px;
}

.support-note {
    background: #f3f4f6;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 3px solid #7e22ce;
}

.support-note p {
    color: #4b5563;
    font-size: 13px;
    margin-bottom: 8px;
    line-height: 1.5;
}

.support-link {
    color: #6b21a8;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 8px 0;
    transition: all 0.2s ease;
}

.support-link:hover {
    color: #581c87;
    gap: 8px;
}

.copyright {
    text-align: center;
    color: #9ca3af;
    font-size: 11px;
    line-height: 1.6;
    padding-top: 15px;
    border-top: 1px solid #e5e7eb;
}

.copyright a {
    color: #6b21a8;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.copyright a:hover {
    color: #581c87;
}

/* =====================================
   ALERT STYLES
===================================== */
.alert {
    border-radius: 12px;
    border: none;
    padding: 12px 48px 12px 16px;
    margin-bottom: 20px;
    font-size: 14px;
    position: relative;
    display: flex;
    align-items: center;
}

.alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border-left: 3px solid #dc2626;
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border-left: 3px solid #f59e0b;
}

.alert .btn-close {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    min-width: 32px;
    min-height: 32px;
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

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

.alert .btn-close:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
    opacity: 1;
}

/* =====================================
   RESPONSIVE
===================================== */
@media (max-width: 768px) {
    .login-container {
        flex-direction: column;
        max-width: 400px;
        min-height: auto;
        padding: 15px;
    }

    .logo-section {
        border-radius: 20px 20px 0 0;
        padding: 30px 25px;
        min-width: auto;
        width: 100%;
    }

    .logo-section img {
        max-width: 150px;
        width: 150px;
    }

    .logo-section h2 {
        font-size: 18px;
    }

    .login-card {
        border-radius: 0 0 20px 20px;
        padding: 30px 25px;
    }

    .login-header h1 {
        font-size: 26px;
    }

    .login-header p {
        font-size: 14px;
    }
}

/* =====================================
   VERY SMALL SCREENS (< 480px)
===================================== */
@media (max-width: 480px) {
    body {
        align-items: flex-start;
        padding-top: 10px;
    }

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

    .logo-section {
        padding: 20px 15px;
        border-radius: 15px 15px 0 0;
    }

    .logo-section img {
        max-width: 120px;
        width: 120px;
        margin-bottom: 12px;
    }

    .logo-section h2 {
        font-size: 16px;
        margin-bottom: 5px;
    }

    .logo-section p {
        font-size: 12px;
        display: none; /* Çok küçük ekranlarda gizle */
    }

    .login-card {
        padding: 25px 20px;
        border-radius: 0 0 15px 15px;
        max-width: 100%;
    }

    .login-header {
        margin-bottom: 20px;
    }

    .login-header h1 {
        font-size: 22px;
    }

    .login-header p {
        font-size: 13px;
    }

    .form-group {
        margin-bottom: 18px;
    }

    .form-label {
        font-size: 13px;
        margin-bottom: 6px;
    }

    .form-control {
        height: 46px;
        padding: 10px 14px;
        font-size: 14px;
        border-radius: 10px;
    }

    .btn-login {
        padding: 12px 16px;
        font-size: 14px;
        min-height: 44px;
        border-radius: 10px;
    }

    .login-footer {
        margin-top: 15px;
        padding-top: 15px;
    }

    .help-links {
        gap: 8px;
        margin-bottom: 15px;
    }

    .help-link {
        font-size: 13px;
        min-height: 40px;
    }

    .support-note {
        padding: 10px 12px;
    }

    .support-note p {
        font-size: 12px;
    }

    .copyright {
        font-size: 10px;
    }

    /* Alert'ler */
    .alert {
        padding: 10px 40px 10px 12px;
        font-size: 13px;
        border-radius: 10px;
    }
}

/* =====================================
   ACTIVE SESSION MODAL - RESPONSIVE
===================================== */
#activeSessionModal .modal-dialog {
    margin: 10px;
    max-width: calc(100% - 20px);
}

@media (max-width: 576px) {
    #activeSessionModal .modal-dialog {
        margin: 5px;
        max-width: calc(100% - 10px);
    }

    #activeSessionModal .modal-content {
        border-radius: 12px;
    }

    #activeSessionModal .modal-header {
        padding: 12px 15px;
    }

    #activeSessionModal .modal-header h5 {
        font-size: 16px;
    }

    #activeSessionModal .modal-body {
        padding: 15px;
        max-height: 60vh;
        overflow-y: auto;
    }

    #activeSessionModal .modal-body .alert {
        padding: 10px;
        font-size: 13px;
    }

    #activeSessionModal .modal-body h6 {
        font-size: 14px;
    }

    #activeSessionModal .modal-body .card {
        margin-bottom: 10px !important;
    }

    #activeSessionModal .modal-body .card-body {
        padding: 12px;
    }

    #activeSessionModal .modal-body .card-body p {
        font-size: 12px;
        margin-bottom: 8px !important;
    }

    #activeSessionModal .modal-body .row {
        flex-direction: column;
    }

    #activeSessionModal .modal-body .col-md-6 {
        width: 100%;
    }

    #activeSessionModal .modal-footer {
        padding: 12px 15px;
        flex-direction: column;
        gap: 8px;
    }

    #activeSessionModal .modal-footer .btn {
        width: 100%;
        margin: 0 !important;
    }
}
