/* ── Variables ─────────────────────────────────────────── */
:root {
    --pri:    #00515e;
    --sec:    #039148;
    --pri-lt: #e6f4f1;
    --dark:   #1e2d2f;
    --muted:  #6b7280;
    --border: #dde3e8;
    --white:  #ffffff;
    --shadow: 0 8px 40px rgba(0,0,0,.10);
}

/* ── Page ─────────────────────────────────────────────── */
.rg-page {
    max-width: 1160px;
    margin: 0 auto;
    padding: 20px 16px 60px;
}

/* ── Card ─────────────────────────────────────────────── */
.rg-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

/* ── Header ───────────────────────────────────────────── */
.rg-header {
    background: linear-gradient(135deg, var(--pri) 0%, var(--sec) 100%);
    color: #fff;
    padding: 20px 32px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 20px;
}
.rg-header::before {
    content: '';
    position: absolute; top:-70px; right:-70px;
    width:220px; height:220px; border-radius:50%;
    background: rgba(255,255,255,.07);
}
.rg-header::after {
    content: '';
    position: absolute; bottom:-50px; left:-50px;
    width:160px; height:160px; border-radius:50%;
    background: rgba(255,255,255,.07);
}
.rg-header-text {
    position: relative; z-index:1;
}
.rg-header h2 {
    margin:0 0 3px; font-size:1.4rem; font-weight:700;
}
.rg-header p {
    margin:0; font-size:.87rem; opacity:.85;
}

/* ── Back link (header) ───────────────────────────────── */
.rg-back {
    display: inline-flex; align-items: center; gap:6px;
    color: rgba(255,255,255,.9); font-size:.82rem; font-weight:600;
    text-decoration: none; flex-shrink: 0;
    background: rgba(255,255,255,.15); border-radius: 20px;
    padding: 7px 15px; position: relative; z-index:1;
    transition: background .2s;
}
.rg-back:hover { background: rgba(255,255,255,.28); color:#fff; }

/* ── Back link (left col) ─────────────────────────────── */
.rg-back-col {
    display: inline-flex; align-items: center; gap:6px;
    color: var(--pri); font-size:.82rem; font-weight:600;
    text-decoration: none; margin-top: 10px;
    border: 1.5px solid var(--pri); border-radius: 20px;
    padding: 7px 16px;
    transition: background .2s, color .2s;
}
.rg-back-col:hover { background: var(--pri); color:#fff; }

/* ── Alerts ───────────────────────────────────────────── */
.rg-alerts { padding: 16px 24px 0; }
.rg-alert {
    background:#fff5f5; border:1px solid #fca5a5;
    border-radius:10px; padding:12px 16px;
    color:#b91c1c; font-size:.88rem; margin-bottom:10px;
}
.rg-alert ul { margin:6px 0 0; padding-left:18px; }

/* ── Two-column body ──────────────────────────────────── */
.rg-body {
    display: flex;
    align-items: stretch;
}

.rg-left {
    flex: 1;
    padding: 30px 28px;
    background: #f2fbf8;
    border-right: 1px solid #c9e8de;
    min-width: 0;
}

.rg-right {
    flex: 1;
    padding: 30px 28px;
    background: #fff;
    min-width: 0;
}

/* ── Section chip ─────────────────────────────────────── */
.rg-chip {
    display: inline-flex; align-items:center; gap:7px;
    font-size:.75rem; font-weight:700;
    text-transform:uppercase; letter-spacing:.07em;
    color: var(--pri); background:#cfe9e2;
    border-radius:20px; padding:4px 14px;
    margin-bottom: 20px;
}
.rg-chip.blue { color:#0a4f7a; background:#d3e9f8; }

/* ── Sub-section label ────────────────────────────────── */
.rg-sub {
    display: flex; align-items: center; gap: 8px;
    font-size: .75rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .06em;
    color: var(--muted); margin: 18px 0 12px;
}
.rg-sub::before {
    content: ''; flex: none;
    width: 3px; height: 14px;
    background: var(--pri); border-radius: 2px;
}
.rg-sub:first-child { margin-top: 0; }

/* ── Fields ───────────────────────────────────────────── */
.rg-field { margin-bottom: 15px; }

.rg-field label {
    display:block; font-size:.81rem; font-weight:600;
    color:#374151; margin-bottom:5px;
}
.rg-field label .req { color:#e74c3c; margin-left:2px; }

.rg-field input,
.rg-field select,
.rg-field textarea {
    width:100%; box-sizing:border-box;
    padding:10px 13px;
    border:1.5px solid var(--border);
    border-radius:9px; font-size:.92rem;
    background:#fff; color:var(--dark);
    transition: border-color .2s, box-shadow .2s;
    outline:none; font-family:inherit;
}
.rg-field input:focus,
.rg-field select:focus,
.rg-field textarea:focus {
    border-color: var(--pri);
    box-shadow: 0 0 0 3px rgba(0,81,94,.1);
}
.rg-field textarea { resize:vertical; min-height:78px; }
.rg-field .err-msg {
    display:block; font-size:.77rem;
    color:#e74c3c; margin-top:4px;
}
.rg-field input.is-invalid,
.rg-field select.is-invalid,
.rg-field textarea.is-invalid {
    border-color:#e74c3c;
}

/* Inline row */
.rg-row { display:flex; gap:12px; }
.rg-row .rg-field { flex:1; }
.rg-row .rg-field.narrow { flex: 0 0 108px; }

/* Password + eye */
.rg-pwd { position:relative; }
.rg-pwd input { padding-right:44px; }
.rg-eye {
    position:absolute; right:0; top:0; bottom:0; width:42px;
    background:none; border:none; color:#9ca3af;
    cursor:pointer; display:flex; align-items:center;
    justify-content:center; font-size:.93rem;
}
.rg-eye:hover { color:var(--pri); }

/* Strength */
.rg-strength { margin-top:7px; }
.rg-strength-bar {
    height:5px; background:#e5e7eb;
    border-radius:3px; overflow:hidden;
}
.rg-strength-fill {
    height:100%; width:0; border-radius:3px;
    transition: width .3s, background .3s;
}
.rg-strength-text {
    font-size:.74rem; font-weight:600;
    text-align:right; margin-top:3px; color:var(--muted);
}

/* Confirm */
.rg-confirm-msg { font-size:.77rem; text-align:right; margin-top:4px; }
.text-success { color:#039148; }
.text-danger, .err-msg { color:#e74c3c; }

/* Rules */
.rg-rules {
    background:#f8f9fb; border:1px solid #e5e7eb;
    border-radius:10px; padding:12px 14px; margin-bottom:14px;
}
.rg-rules-title {
    font-size:.77rem; font-weight:700; color:var(--pri);
    display:flex; align-items:center; gap:6px; margin-bottom:8px;
}
.rg-rules-grid {
    display:grid; grid-template-columns:1fr 1fr; gap:5px 10px;
}
.rg-rule {
    display:flex; align-items:center; gap:6px;
    font-size:.77rem; color:#555;
}
.rg-ri { width:14px; text-align:center; font-size:.83rem; }
.rule-valid { color:#039148; }
.rule-invalid { color:#e74c3c; }

/* Terms */
.rg-terms {
    display:flex; align-items:flex-start; gap:10px;
    padding:11px 13px;
    background:#f2fbf8; border:1px solid #b5ddd2;
    border-radius:9px; margin-bottom:14px;
}
.rg-terms input[type=checkbox] {
    margin-top:3px; width:16px; height:16px;
    cursor:pointer; flex-shrink:0; accent-color:var(--pri);
}
.rg-terms label { font-size:.84rem; color:#333; cursor:pointer; line-height:1.45; }
.rg-terms a { color:var(--pri); font-weight:600; text-decoration:none; }
.rg-terms a:hover { text-decoration:underline; }

/* Submit */
.rg-submit {
    display:flex; align-items:center; justify-content:center; gap:9px;
    width:100%; padding:13px;
    background:linear-gradient(135deg, #039148, #00515e);
    color:#fff; border:none; border-radius:10px;
    font-size:.97rem; font-weight:700; cursor:pointer;
    transition: transform .2s, box-shadow .2s;
    box-shadow: 0 4px 14px rgba(3,145,72,.28);
    margin-bottom:14px; font-family:inherit;
}
.rg-submit:hover {
    transform:translateY(-2px);
    box-shadow:0 8px 22px rgba(3,145,72,.38);
}
.rg-submit:active { transform:translateY(0); }

/* Login redirect */
.rg-redirect { text-align:center; font-size:.84rem; color:#6b7280; }
.rg-redirect a { color:var(--pri); font-weight:600; text-decoration:none; }
.rg-redirect a:hover { text-decoration:underline; }

/* Loader */
#loader-overlay {
    position:fixed; inset:0;
    background:rgba(255,255,255,.92);
    display:none; flex-direction:column;
    justify-content:center; align-items:center; z-index:9999;
}
.loader {
    border:8px solid #f3f3f3;
    border-top:8px solid orange;
    border-right:8px solid #fff;
    border-bottom:8px solid green;
    border-radius:50%; width:70px; height:70px;
    animation:spin 1s linear infinite; margin-bottom:15px;
}
.loader-text { font-size:18px; font-weight:bold; color:#333; }
@keyframes spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ── Modal CGU ────────────────────────────────────────── */
.cgu-overlay {
    display: none;
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(0,0,0,.5);
    align-items: center; justify-content: center;
    padding: 16px;
    backdrop-filter: blur(3px);
}
.cgu-box {
    background: #fff;
    border-radius: 16px;
    width: min(820px, 98vw);
    max-height: 92vh;
    display: flex; flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
    overflow: hidden;
}
.cgu-head {
    background: linear-gradient(135deg, var(--pri) 0%, var(--sec) 100%);
    color: #fff;
    padding: 18px 24px;
    display: flex; align-items: center; justify-content: space-between;
    flex-shrink: 0;
}
.cgu-head-title {
    display: flex; align-items: center; gap: 10px;
    font-size: 1rem; font-weight: 700;
}
.cgu-icon {
    width: 36px; height: 36px; border-radius: 50%;
    background: rgba(255,255,255,.2);
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; flex-shrink: 0;
}
.cgu-close {
    background: rgba(255,255,255,.15); border: none; color: #fff;
    width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; cursor: pointer; transition: background .2s;
    flex-shrink: 0;
}
.cgu-close:hover { background: rgba(255,255,255,.3); }
.cgu-tabs {
    display: flex; border-bottom: 2px solid #e9ecef;
    background: #f8f9fa; flex-shrink: 0;
}
.cgu-tab {
    flex: 1; padding: 12px 16px;
    background: none; border: none; border-bottom: 3px solid transparent;
    margin-bottom: -2px; font-size: .87rem; font-weight: 600;
    color: #6b7280; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 7px;
    transition: color .2s, border-color .2s; font-family: inherit;
}
.cgu-tab:hover { color: var(--pri); }
.cgu-tab.active { color: var(--pri); border-bottom-color: var(--pri); background: #fff; }
.cgu-panels { overflow-y: auto; flex: 1; }
.cgu-panel { display: none; padding: 24px 28px; }
.cgu-panel.active { display: block; }
.cgu-panel-title {
    display: flex; align-items: center; gap: 8px;
    font-size: .97rem; font-weight: 700; color: var(--pri);
    padding-bottom: 10px; border-bottom: 2px solid #d4ede7;
    margin-bottom: 16px;
}
.cgu-panel-body { font-size: .93rem; line-height: 1.75; color: #374151; }
.cgu-empty {
    color: #9ca3af; font-style: italic;
    text-align: center; padding: 40px 0; font-size: .9rem;
}
.cgu-foot {
    padding: 14px 24px;
    border-top: 1px solid #e9ecef; background: #f8f9fa;
    display: flex; align-items: center;
    justify-content: space-between; gap: 10px;
    flex-shrink: 0; flex-wrap: wrap;
}
.cgu-foot-downloads { display: flex; gap: 8px; flex-wrap: wrap; }
.cgu-dl-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px; font-size: .82rem; font-weight: 600;
    border-radius: 8px; cursor: pointer;
    background: #fff; border: 1.5px solid #d1d5db; color: #374151;
    transition: border-color .2s, color .2s; font-family: inherit;
}
.cgu-dl-btn:hover { border-color: var(--pri); color: var(--pri); }
.cgu-accept-btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 9px 22px; font-size: .9rem; font-weight: 700;
    border-radius: 9px; cursor: pointer; border: none;
    background: linear-gradient(135deg, var(--sec), var(--pri));
    color: #fff; transition: opacity .2s, transform .2s;
    box-shadow: 0 4px 12px rgba(3,145,72,.3); font-family: inherit;
}
.cgu-accept-btn:hover { opacity: .92; transform: translateY(-1px); }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 767px) {
    .rg-body { flex-direction:column; }
    .rg-left { border-right:none; border-bottom:1px solid #c9e8de; }
    .rg-rules-grid { grid-template-columns:1fr; }
    .rg-header { padding:22px 20px; }
    .rg-left, .rg-right { padding:22px 16px; }
}
@media (max-width: 479px) {
    .rg-row { flex-direction:column; gap:0; }
    .rg-row .rg-field.narrow { flex:1; }
}
