/* ==========================================================================
   WebStudy - Institutional Login Design System
   Kyiv Cooperative Institute of Business and Law
   Economic and Law College
   ========================================================================== */

:root {
    --brand-navy-dark: #091e33;
    --brand-navy: #0f2942;
    --brand-navy-light: #183e63;
    --brand-blue: #0284c7;
    --brand-blue-hover: #0369a1;
    --brand-blue-light: #e0f2fe;
    --brand-blue-subtle: #f0f9ff;
    --brand-primary: #2563eb;
    
    --text-heading: #0f172a;
    --text-body: #334155;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    
    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --bg-input: #f8fafc;
    --bg-input-focus: #ffffff;
    
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --border-focus: #0284c7;
    
    --danger: #ef4444;
    --danger-light: #fef2f2;
    --danger-border: #fca5a5;
    
    --success: #10b981;
    --success-light: #ecfdf5;
    
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.02);
    --shadow-md: 0 4px 16px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.03);
    --shadow-card: 0 25px 50px -12px rgba(15, 41, 66, 0.12), 0 0 0 1px rgba(226, 232, 240, 0.85);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-pill: 9999px;
    
    --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html, body {
    min-height: 100vh;
    width: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: var(--text-body);
    background-color: var(--bg-page);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --------------------------------------------------------------------------
   Ambient Decorative Background
   -------------------------------------------------------------------------- */
.page-background {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.65;
    transform: translateZ(0);
}

.bg-orb-top-right {
    top: -120px;
    right: -100px;
    width: 550px;
    height: 550px;
    background: radial-gradient(circle, rgba(186, 230, 253, 0.75) 0%, rgba(224, 242, 254, 0.3) 60%, transparent 80%);
}

.bg-orb-bottom-left {
    bottom: -150px;
    left: -120px;
    width: 580px;
    height: 580px;
    background: radial-gradient(circle, rgba(219, 234, 254, 0.7) 0%, rgba(240, 249, 255, 0.35) 60%, transparent 80%);
}

/* --------------------------------------------------------------------------
   Centered Main Wrapper
   -------------------------------------------------------------------------- */
.login-page-wrapper {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px 24px 20px;
    margin: 0 auto;
}

.login-auth-card {
    background: var(--bg-card);
    width: 100%;
    max-width: 440px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 38px 34px 30px 34px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    position: relative;
    overflow: hidden;
    animation: cardAppear 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Top Accent Line */
.login-auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--brand-navy) 0%, var(--brand-blue) 50%, var(--brand-primary) 100%);
}

/* Institutional Emblem & Header */
.card-header-branding {
    text-align: center;
    margin-bottom: 24px;
}

.emblem-wrapper {
    position: relative;
    width: 96px;
    height: 96px;
    margin: 0 auto 16px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border-radius: 50%;
    padding: 6px;
    box-shadow: 0 4px 16px rgba(15, 41, 66, 0.08);
    border: 1px solid var(--border-light);
    transition: var(--transition);
}

.emblem-wrapper:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 20px rgba(15, 41, 66, 0.12);
}

.emblem-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.college-title-main {
    font-size: 13.5px;
    font-weight: 800;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--brand-navy);
    line-height: 1.35;
    margin-bottom: 3px;
}

.institute-title-sub {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    color: var(--text-muted);
    line-height: 1.3;
}

.portal-badge-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 18px 0 18px 0;
    position: relative;
}

.portal-badge-divider::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: var(--border-color);
}

.portal-badge-pill {
    position: relative;
    background: var(--brand-blue-subtle);
    color: var(--brand-blue-hover);
    border: 1px solid #bae6fd;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 16px;
    border-radius: var(--radius-pill);
    letter-spacing: 0.3px;
}

/* --------------------------------------------------------------------------
   Login Form Styles
   -------------------------------------------------------------------------- */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Input Group */
.form-field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field-label {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-heading);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.field-input-box {
    position: relative;
    display: flex;
    align-items: center;
}

.input-leading-icon {
    position: absolute;
    left: 14px;
    color: var(--text-light);
    font-size: 15px;
    pointer-events: none;
    transition: var(--transition);
}

.form-custom-input {
    width: 100%;
    height: 48px;
    padding: 10px 42px 10px 42px;
    font-size: 14.5px;
    font-family: inherit;
    color: var(--text-heading);
    background-color: var(--bg-input);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    outline: none;
    transition: var(--transition);
}

.form-custom-input:focus {
    background-color: var(--bg-input-focus);
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 3.5px rgba(2, 132, 199, 0.14);
}

.form-custom-input::placeholder {
    color: var(--text-light);
    font-size: 14px;
    font-weight: 400;
}

.field-input-box:focus-within .input-leading-icon {
    color: var(--brand-blue);
}

/* Password Visibility Toggle */
.btn-toggle-password {
    position: absolute;
    right: 10px;
    background: transparent;
    border: none;
    color: var(--text-light);
    font-size: 15px;
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-toggle-password:hover {
    color: var(--text-heading);
    background: rgba(0, 0, 0, 0.04);
}

/* Validation Feedback */
.field-error-feedback {
    display: none;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--danger);
    margin-top: 2px;
    animation: fadeIn 0.2s ease-out;
}

.form-field-group.has-error .form-custom-input {
    border-color: var(--danger);
    background-color: var(--danger-light);
}

.form-field-group.has-error .input-leading-icon {
    color: var(--danger);
}

.form-field-group.has-error .field-error-feedback {
    display: flex;
}

/* Global / Server Error Banner */
.server-error-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: var(--danger-light);
    border: 1px solid var(--danger-border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    color: #991b1b;
    font-size: 13.5px;
    font-weight: 500;
    margin-bottom: 6px;
    animation: shakeError 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.server-error-banner i {
    font-size: 16px;
    color: var(--danger);
    flex-shrink: 0;
}

/* Remember me row */
.form-options-row {
    display: flex;
    align-items: center;
    font-size: 13px;
    margin-top: 2px;
}

.custom-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    color: var(--text-muted);
    font-weight: 500;
}

.custom-checkbox-label input[type="checkbox"] {
    position: relative;
    appearance: none;
    -webkit-appearance: none;
    width: 17px;
    height: 17px;
    border: 1.5px solid var(--border-color);
    border-radius: 4px;
    background-color: #ffffff;
    cursor: pointer;
    outline: none;
    transition: var(--transition);
    display: inline-block;
    vertical-align: middle;
}

.custom-checkbox-label input[type="checkbox"]:checked {
    background-color: var(--brand-navy);
    border-color: var(--brand-navy);
}

.custom-checkbox-label input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 5px;
    width: 4px;
    height: 8px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.custom-checkbox-label:hover input[type="checkbox"] {
    border-color: var(--brand-blue);
}

/* Primary Submit Button */
.btn-submit-login {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 48px;
    background-color: var(--brand-navy);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(15, 41, 66, 0.2);
    transition: var(--transition);
    margin-top: 6px;
}

.btn-submit-login:hover {
    background-color: var(--brand-navy-light);
    transform: translateY(-1.5px);
    box-shadow: 0 6px 18px rgba(15, 41, 66, 0.28);
    color: #ffffff;
}

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

.btn-submit-login i {
    font-size: 14px;
    transition: transform 0.2s ease;
}

.btn-submit-login:hover i {
    transform: translateX(4px);
}

.btn-submit-login.is-loading {
    opacity: 0.8;
    pointer-events: none;
}

/* Card Bottom Activation Button */
.card-bottom-activation {
    margin-top: 14px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
    text-align: center;
}

.btn-outline-activation {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 11px 16px;
    background-color: var(--brand-blue-subtle);
    border: 1px solid #bae6fd;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--brand-blue-hover);
    text-decoration: none;
    transition: var(--transition);
}

.btn-outline-activation:hover {
    background-color: #e0f2fe;
    border-color: #7dd3fc;
    color: var(--brand-navy);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-outline-activation i {
    color: var(--brand-blue);
    font-size: 14px;
}

/* Card Bottom Appeal Button */
.card-bottom-appeal {
    margin-top: 10px;
    text-align: center;
}

.btn-outline-appeal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px 16px;
    background-color: var(--bg-page);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-body);
    text-decoration: none;
    transition: var(--transition);
}

.btn-outline-appeal:hover {
    background-color: var(--brand-blue-subtle);
    border-color: #bae6fd;
    color: var(--brand-blue);
    text-decoration: none;
}

.btn-outline-appeal i {
    color: var(--brand-blue);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.login-page-footer {
    position: relative;
    z-index: 1;
    margin-top: 24px;
    font-size: 12.5px;
    color: var(--text-muted);
    text-align: center;
}

/* --------------------------------------------------------------------------
   Animations
   -------------------------------------------------------------------------- */
@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes shakeError {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
    .login-page-wrapper {
        padding: 24px 16px;
    }
    
    .login-auth-card {
        padding: 28px 20px 22px 20px;
    }
    
    .emblem-wrapper {
        width: 82px;
        height: 82px;
    }
    
    .college-title-main {
        font-size: 12px;
    }
    
    .institute-title-sub {
        font-size: 10px;
    }
}