@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

:root {
    --navy: #0f172a;
    --gold: #d97706;
    --gold-light: #fef3c7;
    --blue: #3b82f6;
    --red: #ef4444;
    --red-light: #fee2e2;
    --green: #10b981;
    --green-light: #d1fae5;
    --bg: #f1f5f9;
    --surface: #ffffff;
    --border: #e2e8f0;
    --border-2: #cbd5e1;
    --text: #0f172a;
    --text-2: #334155;
    --text-3: #64748b;
    --text-4: #94a3b8;
    --muted: #64748b;
}

.dark {
    --bg: #0f172a;
    --surface: #1e293b;
    --border: #334155;
    --border-2: #475569;
    --text: #f1f5f9;
    --text-2: #cbd5e1;
    --text-3: #94a3b8;
    --text-4: #64748b;
    --muted: #94a3b8;
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow-wrap: break-word;
    word-break: normal;
    hyphens: none;
    transition: background .18s cubic-bezier(.4,0,.2,1), color .18s cubic-bezier(.4,0,.2,1);
}

.theme-toggle {
    position: fixed;
    top: calc(14px + env(safe-area-inset-top, 0px));
    right: calc(14px + env(safe-area-inset-right, 0px));
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    color: var(--text-2);
    transition: all .18s cubic-bezier(.4,0,.2,1);
    z-index: 10;
}

.theme-toggle:hover {
    background: var(--bg);
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
}

.auth-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
}

.auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 30px 28px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
    text-align: center;
}

.auth-card h1 {
    font-size: 19px;
    font-weight: 700;
    margin: 0 0 4px;
    line-height: 1.3;
    color: var(--navy);
}

.dark .auth-card h1 {
    color: var(--text);
}

.auth-card p.subtitle {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
    margin: 0 0 22px;
}

.auth-card form {
    text-align: left;
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--navy);
}

.dark .form-group label {
    color: var(--text-2);
}

.form-group input {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    background: var(--bg);
    color: var(--text);
}

.form-group input:focus {
    outline: none;
    border-color: var(--gold);
    background: var(--surface);
}

.password-field {
    position: relative;
}

.password-field input {
    padding-right: 44px;
}

.password-toggle {
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-3);
    padding: 0;
}

.password-toggle svg {
    width: 17px;
    height: 17px;
}

.password-toggle:hover {
    color: var(--text-2);
}

.btn-primary {
    width: 100%;
    min-height: 44px;
    padding: 11px;
    background: var(--gold);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}

.btn-primary:hover {
    background: #b45309;
}

.auth-links {
    margin-top: 18px;
    text-align: center;
    font-size: 12.5px;
    line-height: 1.8;
    color: var(--muted);
}

.auth-links a {
    color: var(--gold);
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    min-height: 24px;
}

.auth-links a:hover {
    text-decoration: underline;
}

.alert {
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 12.5px;
    line-height: 1.5;
    margin-bottom: 18px;
    text-align: left;
    overflow-wrap: anywhere;
}

.alert-error {
    background: var(--red-light);
    color: #991b1b;
}

.alert-success {
    background: var(--green-light);
    color: #065f46;
}

.dark .alert-error {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

.dark .alert-success {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
}

.app-footer {
    text-align: center;
    padding: 18px;
    padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    font-size: 11.5px;
    color: var(--muted);
}

@media (max-width: 480px) {
    .auth-card {
        padding: 24px 20px;
    }
}

/* Cegah auto-zoom Safari/Chrome iOS & Android saat fokus input: font-size min 16px di mobile */
@media (max-width: 640px) {
    .form-group input {
        font-size: 16px;
    }
}
