:root {
    --bg1: #eef4ff;
    --bg2: #dfeafb;
    --bg3: #f8fbff;
    --panel: rgba(255, 255, 255, 0.88);
    --panel-strong: rgba(255, 255, 255, 0.96);
    --panel-soft: rgba(244, 248, 255, 0.92);
    --text: #16325c;
    --text-dark: #0f2546;
    --muted: #5f7597;
    --line: rgba(22, 50, 92, 0.10);
    --accent: #f5b32f;
    --accent-dark: #df9d1b;
    --accent-soft: #fff2cc;
    --success: #dff4e8;
    --shadow: 0 16px 34px rgba(34, 69, 122, 0.12);
    --radius-xl: 26px;
    --radius-lg: 18px;
    --radius-md: 14px;
    --radius-sm: 12px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top right, rgba(245,179,47,0.18), transparent 18%),
        radial-gradient(circle at left top, rgba(111,153,255,0.16), transparent 24%),
        linear-gradient(180deg, var(--bg3) 0%, var(--bg1) 48%, var(--bg2) 100%);
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.module-link {
    text-decoration: none;
    color: inherit;
}

.module-card {
    padding: 18px;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(180deg, var(--panel-strong), rgba(239,245,255,0.96));
    text-align: center;
    transition: 0.2s ease;
    cursor: pointer;
}

.module-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 32px rgba(34, 69, 122, 0.16);
}

.module-emoji {
    font-size: 38px;
    line-height: 1;
}

.module-card h3 {
    margin: 0;
    font-size: 18px;
    line-height: 1.35;
    color: var(--text-dark);
}

.index-card {
    margin-top: 12px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--panel-soft);
    text-align: center;
    padding: 14px;
    font-weight: 600;
    transition: 0.2s;
}

.logout-wrapper {
    margin-top: 20px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.logout-wrapper .btn {
    width: 100%;
}

.pin-helper-card {
    margin-top: 14px;
}

.pin-helper-row {
    margin-top: 10px;
}

.nik-simulator-input {
    width: 100%;
    min-height: 44px;
    border-radius: 12px;
    border: 1px solid rgba(22, 50, 92, 0.12);
    background: rgba(255,255,255,0.95);
    color: var(--text-dark);
    padding: 10px 12px;
    outline: none;
}

.pin-preview-box {
    margin-top: 12px;
    padding: 12px;
    border-radius: 14px;
    background: #ffffff;
    border: 1px dashed rgba(22, 50, 92, 0.18);
    text-align: center;
}

.pin-preview-value {
    margin-top: 4px;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 3px;
    color: var(--text-dark);
}

.pin-helper-examples {
    margin-top: 10px;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.5;
}

.index-card a {
    text-decoration: none;
    color: var(--text-dark);
    display: block;
}

.index-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.bottom-actions {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 12px 14px;
    background: transparent;
    display: flex;
    z-index: 100;
}

.bottom-actions .btn {
    flex: 1;
}

.btn-danger {
    background: #ffe5e5;
    color: #b30000;
    border: 1px solid #ffcccc;
}

.pin-wrapper {
    display: flex;
    gap: 8px;
    justify-content: space-between;
}

.pin-box {
    width: 100%;
    max-width: 50px;
    height: 50px;
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: white;
}

.pin-box:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(245,179,47,0.3);
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

.page {
    max-width: 1180px;
    margin: 0 auto;
    padding: 16px 14px 28px;
    padding-bottom: 90px;
}

.hero,
.grid-card,
.module-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.hero {
    padding: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    background: linear-gradient(135deg, rgba(255,255,255,0.96), rgba(236,244,255,0.92));
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.brand-logo {
    width: clamp(110px, 24vw, 220px);
    height: auto;
}

.hero-copy h1 {
    margin: 0;
    font-size: clamp(24px, 4vw, 34px);
    color: var(--text-dark);
}

.hero-copy .eyebrow {
    margin: 0 0 6px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    color: #bf8400;
}

.hero-copy p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
    max-width: 720px;
}

.section-title {
    margin: 18px 4px 12px;
    font-size: 26px;
    color: var(--text-dark);
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.module-card {
    padding: 18px;
    display: flex;
    flex-direction: column;
    min-height: 220px;
    background: linear-gradient(180deg, var(--panel-strong), rgba(239,245,255,0.96));
}

.module-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.module-card h3 {
    margin: 0;
    font-size: 20px;
    line-height: 1.3;
    color: var(--text-dark);
}

.module-card p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.55;
}

.module-footer {
    margin-top: auto;
    padding-top: 16px;
}

.btn {
    min-height: 44px;
    border: 0;
    border-radius: var(--radius-sm);
    padding: 0 16px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--accent);
    color: #2d2200;
    box-shadow: 0 8px 18px rgba(245,179,47,0.28);
}

.btn-primary:hover {
    background: var(--accent-dark);
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    border: 1px solid rgba(191,132,0,0.18);
    background: var(--accent-soft);
    color: #9a6a00;
    white-space: nowrap;
}

.footer-note {
    margin-top: 18px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.grid {
    margin-top: 14px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.grid-card {
    padding: 16px;
}

.card-title {
    margin: 0 0 12px;
    font-size: 18px;
    color: var(--text-dark);
}

.muted {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}

.notice {
    margin-bottom: 12px;
    padding: 12px 13px;
    border-radius: var(--radius-md);
    font-size: 13px;
    line-height: 1.5;
}

.notice.error {
    background: #fff1f1;
    border: 1px solid #ffd0d0;
    color: #b74040;
}

.notice.success {
    background: #eefcf3;
    border: 1px solid #cdeed8;
    color: #1d7c46;
}

form {
    display: grid;
    gap: 12px;
}

label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-dark);
}

input[type="password"],
input[type="datetime-local"],
input[type="text"],
input[type="number"],
select,
textarea {
    width: 100%;
    min-height: 44px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(22, 50, 92, 0.12);
    background: rgba(255,255,255,0.95);
    color: var(--text-dark);
    padding: 10px 12px;
    outline: none;
}

textarea {
    min-height: 100px;
    resize: vertical;
}

input::placeholder,
textarea::placeholder {
    color: #8da0bc;
}

.btn-outline {
    background: white;
    color: var(--text-dark);
    border: 1px solid rgba(22, 50, 92, 0.15);
    box-shadow: 0 6px 14px rgba(34, 69, 122, 0.12);
}

.btn-outline:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(34, 69, 122, 0.18);
}

.row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.mini-card {
    background: var(--panel-soft);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 12px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.info-label {
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 4px;
}

.info-value {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
    word-break: break-word;
    color: var(--text-dark);
}

.switch-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: var(--radius-md);
    background: var(--panel-soft);
    border: 1px solid var(--line);
}

.checkbox {
    width: 20px;
    height: 20px;
    accent-color: var(--accent);
}

.status-pill {
    padding: 10px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    border: 1px solid var(--line);
}

.status-pill.open {
    color: #14653a;
    background: #e8f8ef;
    border-color: #ccebd9;
}

.status-pill.closed {
    color: #a64d4d;
    background: #fff2f2;
    border-color: #ffd6d6;
}

.registered-box {
    margin-top: 12px;
    padding: 12px;
    border-radius: var(--radius-md);
    background: #eefcf3;
    border: 1px solid #cdeed8;
    color: #1d7c46;
}

.top-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.status-pill,
.badge {
    text-align: center;
    justify-content: center;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
}

@media (max-width: 860px) {
    .grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .top-actions {
    align-items: center;
    }
    
    .top-actions > .status-pill,
    .top-actions > .badge {
        width: 100%;
        max-width: 100%;
        text-align: center;
        justify-content: center;
    }
    .page {
        padding: 12px 10px 24px;
    }

    .hero,
    .grid-card,
    .module-card {
        border-radius: 22px;
    }

    .hero {
        padding: 14px;
        align-items: flex-start;
    }

    .brand {
        gap: 10px;
        align-items: flex-start;
    }

    .brand-logo {
        width: 118px;
    }

    .hero-copy h1 {
        font-size: 28px;
    }

    .hero-copy p {
        font-size: 13px;
    }

    .section-title {
        font-size: 22px;
        margin-top: 16px;
    }

    .modules-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .module-card {
        min-height: 190px;
        padding: 14px;
    }

    .module-card h3 {
        font-size: 17px;
    }

    .module-card p {
        font-size: 13px;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .btn {
        width: 100%;
    }
}