/* Copied from server/static/style.css to keep portal standalone */
/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Geologica', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.4;
    color: #302403;
    background-color: #F8F9FA;
    overflow-x: hidden;
}

/* Brand logo (SVG) */
.brand-logo {
    --logo-h: 34px;
    --mx: 50%;
    --my: 50%;
    --dx: 0px;
    --dy: 0px;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    height: var(--logo-h);
    min-width: calc(var(--logo-h) * 1);
}

.brand-bg {
    position: absolute;
    left: 0;
    top: 50%;
    width: var(--logo-h);
    height: var(--logo-h);
    transform: translateY(-50%);
    background: #ffde2f;
}

.brand-mark {
    position: relative;
    z-index: 1;
    height: var(--logo-h);
    width: auto;
    display: block;
    filter:
      drop-shadow(var(--dx) var(--dy) 10px rgba(255, 255, 255, 0.55))
      drop-shadow(0 0 10px rgba(255, 255, 255, 0.18));
    transition: filter 120ms ease, transform 120ms ease;
}

.brand-logo.is-hover .brand-mark {
    filter:
      drop-shadow(var(--dx) var(--dy) 14px rgba(255, 255, 255, 0.65))
      drop-shadow(0 0 12px rgba(255, 255, 255, 0.22));
}

/* Eye pupils for "песец" letters 'е' */
.eye-pupil {
    --pupil-dx: 0px;
    --pupil-dy: 0px;
    position: absolute;
    width: 7px;
    height: 7px;
    background: #231f20;
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
    z-index: 3;
    transform: translate(-50%, -50%) translate(var(--pupil-dx), var(--pupil-dy));
    transition: opacity 200ms ease, transform 80ms ease-out, height 150ms ease-out;
}

/* Blink animation - сужение высоты для моргания */
@keyframes blink {
    0%, 100% { height: 7px; }
    50% { height: 0.1px; }
}

/* Squint animation - прищуривание (удержание суженными) */
@keyframes squint {
    0% { height: 7px; }
    20% { height: 3px; }
    80% { height: 3px; }
    100% { height: 7px; }
}

.eye-pupil.is-blinking {
    animation: blink 200ms ease-in-out;
}

.eye-pupil.is-squinting {
    animation: squint 4000ms ease-in-out;
}

/* Position first 'е' pupil (левый глаз) */
/* Калибровка: left=120px, top=45px (поднято на 1px) */
.eye-pupil-1 {
    left: 120px;
    top: 45px;
}

/* Position second 'е' pupil (правый глаз) */
/* Калибровка: left=161px, top=45px (поднято на 1px) */
.eye-pupil-2 {
    left: 161px;
    top: 45px;
}

/* Show pupils when cursor is near */
.brand-logo.is-near .eye-pupil {
    opacity: 1;
}

/* Disable animations for reduced motion, but keep pupils visible */
@media (prefers-reduced-motion: reduce) {
    .eye-pupil {
        transition: none;
    }
}

/* Dynamic text with Matrix-style roll effect */
.brand-dynamic-text {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #9CA3AF; /* Серый цвет */
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: 400;
    margin-left: 10px;
    min-height: 28px;
    line-height: 28px;
}

.roll-part {
    display: inline-block;
    position: relative;
    overflow: hidden;
    vertical-align: middle;
    height: 1.2em;
    line-height: 1.2em;
}

.roll-part::before {
    content: attr(data-current);
    display: block;
    position: relative;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out, filter 0.3s ease-out;
}

/* Matrix-style roll animation - эффект "падения" символов */
@keyframes matrix-roll {
    0% {
        transform: translateY(0) scaleY(1);
        opacity: 1;
        filter: blur(0px);
    }
    30% {
        transform: translateY(-50%) scaleY(0.8);
        opacity: 0.5;
        filter: blur(1px);
    }
    70% {
        transform: translateY(50%) scaleY(0.8);
        opacity: 0.5;
        filter: blur(1px);
    }
    100% {
        transform: translateY(0) scaleY(1);
        opacity: 1;
        filter: blur(0px);
    }
}

.roll-part.is-rolling::before {
    animation: matrix-roll 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Disable animation for reduced motion */
@media (prefers-reduced-motion: reduce) {
    .roll-part.is-rolling {
        animation: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .brand-mark {
        transition: none;
        filter: none;
    }
    .brand-logo.is-hover .brand-mark {
        filter: none;
    }
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Geologica', sans-serif;
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
}

h1 { font-size: 32px; }
h2 { font-size: 24px; }
h3 { font-size: 20px; }
h4 { font-size: 18px; }
h5 { font-size: 16px; }

p {
    font-size: 16px;
    line-height: 1.5;
    margin: 0;
}

a {
    color: #D6B301;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #B89A00;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-family: inherit;
}

.btn-primary {
    background-color: #D6B301;
    color: #FFFFFF;
    -webkit-text-fill-color: currentColor !important;
}

.btn-primary:hover {
    background-color: #B89A00;
    transform: translateY(-2px);
    color: #FFFFFF;
    -webkit-text-fill-color: currentColor !important;
}

.btn-outline {
    background-color: transparent;
    color: #302403;
    border: 2px solid #E5E7EB;
    -webkit-text-fill-color: currentColor !important;
}

.btn-outline:visited,
.btn-outline:focus,
.btn-outline:focus-visible {
    color: #302403;
    -webkit-text-fill-color: currentColor !important;
}

.btn-outline:hover {
    background-color: #302403;
    color: #FFFFFF;
    border-color: #302403;
    -webkit-text-fill-color: currentColor !important;
}

.btn-outline:active {
    color: #FFFFFF;
    -webkit-text-fill-color: currentColor !important;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
}

.btn-danger {
    background-color: #E74C3C;
    color: #FFFFFF;
}

.btn-danger:hover {
    background-color: #C0392B;
}

.btn-success {
    background-color: #27AE60;
    color: #FFFFFF;
}

.btn-success:hover {
    background-color: #229954;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    background-color: #FFFFFF;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

th, td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid #E5E7EB;
}

th {
    background-color: #F8F9FA;
    font-weight: 600;
    color: #302403;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tr:hover {
    background-color: #F8F9FA;
}

tr:last-child td {
    border-bottom: none;
}

td a {
    color: #D6B301;
    font-weight: 500;
}

td a:hover {
    color: #B89A00;
    text-decoration: underline;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #302403;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #E5E7EB;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background-color: #FFFFFF;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #D6B301;
    box-shadow: 0 0 0 3px rgba(214, 179, 1, 0.1);
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23302403' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

/* Cards */
.card {
    background-color: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid #E5E7EB;
    background-color: #F8F9FA;
}

.card-body {
    padding: 24px;
}

/* Alerts */
.alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
}

.alert-success {
    background-color: #D4EDDA;
    color: #155724;
    border-left: 4px solid #27AE60;
}

.alert-error {
    background-color: #F8D7DA;
    color: #721C24;
    border-left: 4px solid #E74C3C;
}

.alert-warning {
    background-color: #FFF3CD;
    color: #856404;
    border-left: 4px solid #F39C12;
}

.alert-info {
    background-color: #D1ECF1;
    color: #0C5460;
    border-left: 4px solid #3498DB;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
    padding: 16px;
    background-color: #FFFFFF;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.pagination a {
    padding: 8px 16px;
    background-color: #F8F9FA;
    border-radius: 6px;
    color: #302403;
    font-weight: 500;
    transition: all 0.3s ease;
}

.pagination a:hover {
    background-color: #D6B301;
    color: #FFFFFF;
}

.pagination span {
    color: #6B7280;
    font-size: 14px;
}

/* Status Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background-color: #D4EDDA;
    color: #155724;
}

.badge-warning {
    background-color: #FFF3CD;
    color: #856404;
}

.badge-danger {
    background-color: #F8D7DA;
    color: #721C24;
}

.badge-info {
    background-color: #D1ECF1;
    color: #0C5460;
}

/* Login Page Specific */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #F8F9FA 0%, #E5E7EB 100%);
}

.login-card {
    width: 100%;
    max-width: 400px;
    background-color: #FFFFFF;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 40px;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
}

.login-logo .brand-logo {
    --logo-h: 42px;
}

.login-logo .brand-dynamic-text {
    font-size: 16px;
    margin-left: 12px;
}

.login-logo i {
    font-size: 32px;
    color: #D6B301;
}

.login-logo span {
    font-size: 24px;
    font-weight: 700;
    color: #302403;
}

.login-title {
    font-size: 20px;
    color: #6B7280;
    font-weight: 400;
}

.login-form .form-group {
    margin-bottom: 24px;
}

.login-form .btn {
    width: 100%;
    padding: 14px;
    font-size: 16px;
}

.login-error {
    background-color: #FEF2F2;
    color: #DC2626;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 14px;
    border-left: 4px solid #E74C3C;
}

/* Responsive */
@media (max-width: 768px) {
    h1 { font-size: 24px; }
    h2 { font-size: 20px; }
    
    .btn {
        padding: 10px 20px;
    }
    
    th, td {
        padding: 12px 8px;
        font-size: 14px;
    }
    
    .login-card {
        margin: 20px;
        padding: 30px 20px;
    }
}

/* Focus styles for accessibility */
.btn:focus,
input:focus,
select:focus,
button:focus {
    outline: 2px solid #D6B301;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    .btn, .pagination {
        display: none;
    }
}

