/* parent/parent.css — shared styles for all parent pages */

:root {
    --primary: #7c3aed;
    --primary-dark: #5b21b6;
    --primary-shadow: #4c1d95;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow-border: #cbd5e1;
    --danger: #ef4444;
    --danger-dark: #b91c1c;
}

* {
    box-sizing: border-box;
    font-family: 'Nunito', 'Microsoft YaHei', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: linear-gradient(135deg, #c4b5fd 0%, #a5b4fc 100%);
    margin: 0;
    padding: 15px;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 480px;
    background: rgba(255, 255, 255, 0.97);
    padding: 30px 24px 40px;
    border-radius: 40px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12);
    text-align: center;
    border: 4px solid #fff;
    backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 5vh;
    margin-bottom: auto;
    animation: fadeUp 0.35s ease-out;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Page heading ── */
.page-logo {
    font-size: 52px;
    margin-bottom: 6px;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}

.page-title {
    margin: 0 0 4px;
    font-size: 28px;
    font-weight: 900;
    color: #0f172a;
}

.page-subtitle {
    margin: 0 0 28px;
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 800;
}

/* ── Form ── */
.form-group {
    width: 100%;
    margin-bottom: 14px;
    text-align: left;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 900;
    color: var(--text-muted);
    margin-bottom: 6px;
    padding-left: 4px;
}

.form-input {
    width: 100%;
    padding: 14px 18px;
    border: 3px solid var(--border);
    border-radius: 16px;
    font-size: 16px;
    font-weight: 800;
    font-family: inherit;
    color: var(--text-main);
    background: #f8fafc;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}

.form-input:focus   { border-color: #a78bfa; background: #faf5ff; }
.form-input.error   { border-color: #fca5a5; background: #fef2f2; }

/* ── Buttons ── */
.btn-primary {
    width: 100%;
    padding: 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 18px;
    font-size: 18px;
    font-weight: 900;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 6px 0 var(--primary-dark);
    margin-top: 6px;
    transition: opacity 0.15s;
}

.btn-primary:active   { transform: translateY(6px); box-shadow: none; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: 0 6px 0 var(--primary-dark); }

.btn-secondary {
    width: 100%;
    padding: 14px;
    background: white;
    color: var(--text-muted);
    border: 3px solid var(--border);
    border-radius: 18px;
    font-size: 16px;
    font-weight: 900;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 4px 0 var(--shadow-border);
    margin-top: 8px;
}

.btn-secondary:active { transform: translateY(4px); box-shadow: none; }

.btn-danger {
    background: var(--danger);
    box-shadow: 0 6px 0 var(--danger-dark);
    border: none;
    color: white;
}

.btn-danger:active { transform: translateY(6px); box-shadow: none; }

/* ── Toggle link (sign in / register) ── */
.auth-toggle {
    margin-top: 20px;
    font-size: 14px;
    font-weight: 800;
    color: var(--text-muted);
}

.auth-toggle a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 900;
    cursor: pointer;
}

.auth-helper {
    width: 100%;
    text-align: right;
    margin: -6px 0 12px;
    font-size: 13px;
    font-weight: 800;
}

.auth-helper a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 900;
}

.parent-auth-top {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.parent-auth-top .back-link {
    margin: 0;
    text-align: left;
}

.parent-lang-btn {
    border: 2px solid var(--border);
    background: #fff;
    color: var(--primary);
    font-weight: 900;
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 3px 0 var(--shadow-border);
    flex-shrink: 0;
}

.parent-lang-btn:active {
    transform: translateY(2px);
    box-shadow: none;
}

.auth-guide-link {
    width: 100%;
    margin-top: 16px;
    font-size: 13px;
    font-weight: 800;
}

.auth-guide-link a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 900;
}

.consent-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    margin: 4px 0 14px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.45;
    color: #334155;
    cursor: pointer;
}

.consent-label input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.consent-label a {
    color: var(--primary);
    font-weight: 900;
}

/* ── Error / info message ── */
.msg-error {
    width: 100%;
    padding: 12px 16px;
    background: #fef2f2;
    border: 2px solid #fca5a5;
    border-radius: 14px;
    color: var(--danger);
    font-size: 14px;
    font-weight: 800;
    margin-bottom: 12px;
    display: none;
}

.msg-error.visible { display: block; }

.msg-info {
    width: 100%;
    padding: 12px 16px;
    background: #f0fdf4;
    border: 2px solid #86efac;
    border-radius: 14px;
    color: #15803d;
    font-size: 14px;
    font-weight: 800;
    margin-bottom: 12px;
    display: none;
}

.msg-info.visible { display: block; }

/* ── Divider ── */
.divider {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 18px 0;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 800;
}

.divider::before, .divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ── Back link ── */
.back-link {
    font-size: 13px;
    font-weight: 900;
    color: var(--text-muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 18px;
    align-self: flex-start;
}

.back-link:hover { color: var(--primary); }

/* ── Loading spinner ── */
.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255,255,255,0.4);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (min-width: 600px) {
    .container { padding: 40px 40px 50px; }
}
