/* ============================================
   БАЗА — светлая, чистая, корпоративная
   ============================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary: #10b981;
    --primary-dark: #059669;
    --primary-light: #d1fae5;
    --accent: #0ea5e9;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #0f172a;
    --gray: #64748b;
    --gray-light: #f1f5f9;
    --border: #e2e8f0;
    --white: #ffffff;
    --bg: #f8fafc;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

.bg-grid {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(16, 185, 129, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(16, 185, 129, 0.04) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: 0;
    pointer-events: none;
}

/* ============================================
   NAV
   ============================================ */
nav {
    position: relative;
    z-index: 10;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.15rem;
}

.logo { font-size: 1.5rem; }

.brand-text {
    font-weight: 800;
    color: var(--dark);
    letter-spacing: -0.5px;
}

.brand-sub {
    color: var(--gray);
    font-size: 0.85rem;
    padding: 0.15rem 0.5rem;
    background: var(--gray-light);
    border-radius: 6px;
    font-weight: 500;
}

.nav-links { display: flex; gap: 0.5rem; }

.nav-link {
    color: var(--gray);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.nav-link:hover {
    color: var(--primary);
    background: var(--primary-light);
}

/* ============================================
   MAIN
   ============================================ */
main {
    position: relative;
    z-index: 5;
    flex: 1;
    padding: 3rem 1rem;
}

.container {
    max-width: 780px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.container.narrow { max-width: 440px; }

/* ============================================
   WELCOME CARD (главная)
   ============================================ */
.welcome-card {
    background: var(--white);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid var(--border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.welcome-header {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
    letter-spacing: -0.5px;
    margin-bottom: 0.3rem;
}

.subtitle {
    color: var(--gray);
    font-size: 0.9rem;
}

.info-row {
    display: grid;
    grid-template-columns: 1fr 1.5fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.info-block {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 1rem;
    background: var(--gray-light);
    border-radius: 10px;
}

.info-label {
    font-size: 0.7rem;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.info-value {
    font-weight: 700;
    color: var(--dark);
    font-size: 1.1rem;
}

.info-value.small { font-size: 0.85rem; word-break: break-all; }

.badge {
    display: inline-block;
    padding: 0.3rem 0.7rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-align: center;
}

.badge-top-secret {
    background: #fee2e2;
    color: #991b1b;
}
.badge-internal {
    background: #fef3c7;
    color: #92400e;
}
.badge-public {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.btn-primary {
    display: block;
    background: var(--primary);
    color: var(--white);
    text-decoration: none;
    text-align: center;
    padding: 1rem;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
}

/* ============================================
   HINT CARD
   ============================================ */
.hint-card {
    display: flex;
    gap: 1rem;
    padding: 1.2rem;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 12px;
    font-size: 0.9rem;
}

.hint-icon { font-size: 1.3rem; flex-shrink: 0; }
.hint-title { font-weight: 700; color: #92400e; margin-bottom: 0.4rem; }
.hint-muted { color: var(--gray); font-style: italic; margin-top: 0.3rem; }

/* ============================================
   LOGIN CARD
   ============================================ */
.login-card {
    background: var(--white);
    border-radius: 16px;
    padding: 2.5rem;
    border: 1px solid var(--border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    animation: slideUp 0.4s ease;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: inline-block;
}

.login-header h1 {
    font-size: 1.3rem;
    margin-bottom: 0.3rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.login-form label {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.label-text {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.login-form input {
    padding: 0.9rem 1rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s;
    background: var(--bg);
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

.login-form button {
    padding: 1rem;
    border: none;
    border-radius: 10px;
    background: var(--primary);
    color: var(--white);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 0.5rem;
    font-family: inherit;
}

.login-form button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
}

.error-box {
    background: #fee2e2;
    color: #991b1b;
    padding: 0.9rem;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

.login-footer {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 0.85rem;
    color: var(--gray);
}

/* ============================================
   PROFILE CARD
   ============================================ */
.profile-card {
    background: var(--white);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid var(--border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    animation: slideUp 0.4s ease;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    color: var(--white);
    background: linear-gradient(135deg, var(--primary), var(--accent));
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.profile-avatar.clearance-top-secret {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.profile-avatar.clearance-internal {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.profile-title { flex: 1; }

.profile-title h1 { margin-bottom: 0.2rem; }

.profile-status {
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.profile-status.own {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.profile-status.other {
    background: #fef3c7;
    color: #92400e;
}

.warning-box {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    padding: 1rem 1.2rem;
    background: #fffbeb;
    border-left: 4px solid var(--warning);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: #92400e;
}

.warning-box span { font-size: 1.2rem; }

.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 1rem;
    background: var(--gray-light);
    border-radius: 10px;
}

.field.wide { grid-column: 1 / -1; }

.field-label {
    font-size: 0.7rem;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.field-value {
    color: var(--dark);
    font-weight: 600;
    word-break: break-word;
}

.field-value.bio {
    font-weight: 400;
    line-height: 1.6;
    color: #334155;
}

.secret-block {
    background: #f0fdf4;
    border: 2px dashed var(--primary);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    animation: pulse-border 2s ease-in-out infinite;
}

@keyframes pulse-border {
    0%, 100% { border-color: var(--primary); }
    50% { border-color: var(--primary-dark); }
}

.secret-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.secret-icon { font-size: 1.3rem; }

.flag {
    background: var(--white);
    color: var(--primary-dark);
    padding: 1.2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Courier New', monospace;
    font-weight: 700;
    text-align: center;
    word-break: break-all;
    border: 1px solid var(--primary-light);
}

.profile-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-secondary {
    display: inline-block;
    color: var(--gray);
    text-decoration: none;
    padding: 0.7rem 1.2rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-secondary:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-light);
}

/* ============================================
   ОБЩЕЕ
   ============================================ */
p { margin: 0.3rem 0; }

code {
    background: var(--gray-light);
    padding: 0.15rem 0.4rem;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    color: var(--primary-dark);
    font-weight: 600;
    font-size: 0.85em;
}

.muted { color: var(--gray); }
.small { font-size: 0.8rem; }

/* ============================================
   FOOTER
   ============================================ */
footer {
    position: relative;
    z-index: 5;
    text-align: center;
    padding: 1.5rem;
    color: var(--gray);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
    background: var(--white);
}

footer .small { color: #94a3b8; font-size: 0.75rem; margin-top: 0.3rem; }

/* ============================================
   АДАПТИВНОСТЬ
   ============================================ */
@media (max-width: 600px) {
    .info-row { grid-template-columns: 1fr; }
    .profile-grid { grid-template-columns: 1fr; }
    nav { padding: 0.8rem 1rem; }
    .brand-sub { display: none; }
    .container { padding: 0; }
}