:root {
    --theme-deafult: #0b6a63;
    --theme-secondary: #ff6b4a;
    --gate-teal: var(--theme-deafult);
    --gate-teal-dark: color-mix(in srgb, var(--theme-deafult) 82%, #000);
    --gate-mint: color-mix(in srgb, var(--theme-deafult) 12%, #fff);
    --gate-secondary: var(--theme-secondary);
    --gate-input: #e8eefc;
    --gate-text: #1f2a37;
    --gate-muted: #6b7c85;
    --gate-card: #ffffff;
}

* { box-sizing: border-box; }

body.gate-body {
    margin: 0;
    min-height: 100vh;
    font-family: "Montserrat", system-ui, sans-serif;
    color: var(--gate-text);
    background: #f4f8f8 url("../riho/images/login/login_bg.jpg") center / cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 36px 16px;
}

.gate-page {
    width: 100%;
    max-width: 460px;
}

.gate-brand {
    text-align: center;
    margin: 0 0 22px;
}

.gate-riho {
    display: block;
    height: 44px;
    width: auto;
    margin: 0 auto 14px;
}

.gate-product {
    margin: 0;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: var(--gate-teal);
    line-height: 1.15;
}

.gate-card {
    width: 100%;
    background: var(--gate-card);
    border-radius: 16px;
    box-shadow: 0 18px 50px rgba(8, 21, 66, 0.08);
    padding: 32px 30px 24px;
    position: relative;
    overflow: hidden;
}

.gate-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--gate-teal), var(--gate-secondary));
}

.gate-card h2 {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 700;
}

.gate-card p.lead {
    margin: 0 0 22px;
    color: var(--gate-muted);
    font-size: 13px;
}

.gate-field {
    margin-bottom: 16px;
}

.gate-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
}

.gate-field input,
.gate-field select {
    width: 100%;
    border: 1px solid transparent;
    outline: none;
    background: var(--gate-input);
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 14px;
    font-family: inherit;
    color: var(--gate-text);
}

.gate-field input:focus,
.gate-field select:focus {
    border-color: color-mix(in srgb, var(--gate-teal) 35%, #fff);
    box-shadow: 0 0 0 2px rgba(11, 106, 99, 0.18);
}

.gate-btn {
    width: 100%;
    border: 0;
    border-radius: 8px;
    background: var(--gate-teal);
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    padding: 12px 16px;
    cursor: pointer;
    font-family: inherit;
    margin-top: 8px;
}

.gate-btn:hover { background: var(--gate-teal-dark); }

.gate-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.gate-alert {
    background: #fde8e8;
    color: #8a1f1f;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
    margin-bottom: 14px;
}

.gate-alert.ok {
    background: #e6f6ee;
    color: #146c43;
}

.gate-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
    font-size: 13px;
}

.gate-auth-links {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #e8eeeb;
    text-align: center;
}

.gate-auth-links a {
    color: var(--gate-teal);
    text-decoration: none;
    font-weight: 600;
    font-size: 12px;
    line-height: 1.3;
    padding: 4px 2px;
}

.gate-auth-links a:hover {
    text-decoration: underline;
}

.gate-links a,
.gate-links button,
.gate-logout {
    color: var(--gate-teal);
    text-decoration: none;
    font-weight: 600;
    background: none;
    border: 0;
    cursor: pointer;
    font-family: inherit;
    padding: 0;
}

.gate-hint {
    margin: 16px 0 0;
    font-size: 12px;
    color: var(--gate-muted);
}

.gate-user {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-bottom: 22px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e6eeeb;
}

.gate-user img {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--gate-mint);
}

.gate-user h3 {
    margin: 0 0 4px;
    font-size: 16px;
}

.gate-user p {
    margin: 0;
    font-size: 12px;
    color: var(--gate-muted);
}

.gate-modules {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}

.gate-module {
    border: 1px solid #d9e6e2;
    background: #fff;
    border-radius: 10px;
    padding: 12px 10px;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    color: var(--gate-text);
}

.gate-module strong {
    display: block;
    font-size: 13px;
}

.gate-module span {
    display: block;
    font-size: 11px;
    color: var(--gate-muted);
    margin-top: 2px;
}

.gate-module.is-on {
    border-color: var(--gate-teal);
    background: var(--gate-mint);
    box-shadow: 0 0 0 2px rgba(11, 106, 99, 0.18);
}

@media (max-width: 520px) {
    .gate-product { font-size: 24px; }
    .gate-card { padding: 26px 18px 20px; }
    .gate-auth-links {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}
