* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Courier New', Courier, monospace;
    background-color: #0a0e14;
    background-image: 
        linear-gradient(rgba(10, 14, 20, 0.9), rgba(10, 14, 20, 0.9)),
        url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><rect width="100" height="100" fill="none" /><path d="M10 10 L 90 10 M10 30 L 90 30 M10 50 L 90 50 M10 70 L 90 70 M10 90 L 90 90 M10 10 L 10 90 M30 10 L 30 90 M50 10 L 50 90 M70 10 L 70 90 M90 10 L 90 90" stroke="%23344e5c" stroke-width="0.5" opacity="0.2"/></svg>');
    color: #d3d7de;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    max-width: 1200px;
    width: 100%;
    background-color: rgba(20, 27, 36, 0.95);
    backdrop-filter: blur(2px);
    border: 1px solid #2a3a4a;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.7), 0 0 10px rgba(240, 179, 123, 0.3);
    padding: 30px;
    transition: box-shadow 0.3s;
}

.container:hover {
    box-shadow: 0 0 40px rgba(240, 179, 123, 0.2), 0 0 20px rgba(0, 150, 255, 0.2);
}

/* Заголовок */
.header {
    border-bottom: 1px solid #2a3a4a;
    padding-bottom: 20px;
    margin-bottom: 30px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.header h1 {
    font-size: 1.8rem;
    letter-spacing: 2px;
    color: #f0b37b;
    text-transform: uppercase;
    font-weight: normal;
    text-shadow: 0 0 5px #f0b37b, 0 0 10px rgba(240, 179, 123, 0.5);
    animation: flicker 3s infinite;
}

@keyframes flicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.95; text-shadow: 0 0 8px #f0b37b, 0 0 20px #f0b37b; }
}

.header .badge {
    color: #8aa2b3;
    font-size: 0.9rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid #2a4a5a;
    backdrop-filter: blur(4px);
}

/* Форма входа */
.login-section {
    max-width: 400px;
    margin: 40px auto;
}

.login-form {
    background: rgba(30, 42, 50, 0.9);
    backdrop-filter: blur(4px);
    padding: 30px;
    border-radius: 8px;
    border-left: 4px solid #f0b37b;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    transition: transform 0.2s;
}

.login-form:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(240, 179, 123, 0.2);
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #b3c7d8;
    font-size: 0.95rem;
    letter-spacing: 1px;
}

label i {
    margin-right: 8px;
    color: #f0b37b;
}

input {
    width: 100%;
    padding: 12px 15px;
    background: #0f1a22;
    border: 1px solid #2a4a5a;
    border-radius: 4px;
    font-family: inherit;
    color: #e0e9f0;
    font-size: 1rem;
    outline: none;
    transition: all 0.2s;
}

input:focus {
    border-color: #f0b37b;
    box-shadow: 0 0 10px #f0b37b, inset 0 0 5px #2a4a5a;
}

.btn {
    display: inline-block;
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #2d4e5c 0%, #1f3a44 100%);
    color: white;
    border: none;
    border-radius: 4px;
    font-family: inherit;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.btn: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;
}

.btn:hover:before {
    left: 100%;
}

.btn:hover {
    background: linear-gradient(135deg, #3e6a7c 0%, #2d4e5c 100%);
    box-shadow: 0 0 15px #3e6a7c;
    transform: scale(1.02);
}

.error-message {
    color: #e66b6b;
    margin-top: 15px;
    text-align: center;
    font-size: 0.9rem;
    min-height: 20px;
    text-shadow: 0 0 5px #e66b6b;
}

/* Галерея */
.gallery-section {
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 25px;
    padding: 10px 0;
    border-bottom: 1px dashed #2a4a5a;
}

.stats {
    color: #8aa2b3;
    font-size: 0.95rem;
    background: rgba(0,0,0,0.2);
    padding: 5px 15px;
    border-radius: 20px;
    backdrop-filter: blur(2px);
}

.stats span {
    color: #f0b37b;
    font-weight: bold;
}

.stats i {
    margin-right: 5px;
    color: #f0b37b;
}

#logoutBtn {
    width: auto;
    padding: 8px 20px;
    background: #3d4f5c;
    font-size: 0.9rem;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
}

.photo-card {
    background: #1b2630;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #2e4050;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
    position: relative;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

.photo-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: #f0b37b;
    box-shadow: 0 15px 30px rgba(240, 179, 123, 0.3);
}

.photo-card:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(240,179,123,0.1) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.photo-card:hover:after {
    opacity: 1;
}

.photo-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    border-bottom: 1px solid #2e4050;
    transition: transform 0.3s;
}

.photo-card:hover img {
    transform: scale(1.05);
}

.photo-card .caption {
    padding: 12px;
    font-size: 0.9rem;
    color: #cbd5e0;
    text-align: center;
    background: #121d26;
    position: relative;
    z-index: 1;
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.95);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
    animation: modalFade 0.3s;
}

@keyframes modalFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal.active {
    display: flex;
}

.modal-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
    border: 2px solid #f0b37b;
    border-radius: 8px;
    box-shadow: 0 0 50px rgba(240, 179, 123, 0.5);
    animation: modalZoom 0.3s;
}

@keyframes modalZoom {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-content img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 6px;
}

.modal-close {
    position: absolute;
    top: -45px;
    right: 0;
    font-size: 2rem;
    color: white;
    background: none;
    border: none;
    cursor: pointer;
    font-family: monospace;
    transition: color 0.2s, transform 0.2s;
}

.modal-close:hover {
    color: #f0b37b;
    transform: scale(1.2);
}

/* Кастомный скроллбар */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #1b2630;
}

::-webkit-scrollbar-thumb {
    background: #3a5068;
    border-radius: 5px;
    border: 2px solid #1b2630;
}

::-webkit-scrollbar-thumb:hover {
    background: #f0b37b;
}

/* Адаптивность */
@media (max-width: 600px) {
    .container { padding: 15px; }
    .header h1 { font-size: 1.3rem; }
    .photo-grid { gap: 15px; }
    .gallery-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    #logoutBtn { width: 100%; }
}