@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,200..800&family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&display=swap');

:root {
    --primary: #0a5c40;
    --primary-light: #117a56;
    --primary-dark: #06452e;
    --primary-glow: rgba(10, 92, 64, 0.1);
    --accent: #f0a500;
    --accent-light: #fff8e6;
    --danger: #dc2626;
    --success: #10b981;
    --bg: #f4f6f5;
    --surface: #ffffff;
    --border: #e5e9e8;
    --text: #1a2e26;
    --text-muted: #6b847a;
    --text-light: #9ca3af;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 35px -8px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    --font-display: 'Bricolage Grotesque', system-ui, sans-serif;
    --font-body: 'DM Sans', system-ui, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-light);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ---------- Alerts ---------- */

.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 22px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    border: 1px solid transparent;
}

.alert .icon {
    margin-top: 1px;
}

.alert-error {
    color: #991b1b;
    background: #fef2f2;
    border-color: #fecaca;
}

.alert-success {
    color: #065f46;
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.alert-info {
    color: #7a5300;
    background: var(--accent-light);
    border-color: #fde7b0;
}

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 50px;
    padding: 0 20px;
    font: inherit;
    font-weight: 700;
    font-size: 15px;
    color: #fff;
    background: var(--primary);
    border: 0;
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 18px -6px rgba(10, 92, 64, 0.45);
    cursor: pointer;
    transition: var(--transition);
}

.btn:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: 0 12px 24px -8px rgba(10, 92, 64, 0.5);
}

.btn:active {
    transform: none;
}

.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px var(--primary-glow), 0 0 0 2px var(--primary);
}

.btn[disabled],
.btn.is-loading {
    opacity: 0.75;
    cursor: not-allowed;
    transform: none;
}

.btn.is-loading .icon {
    display: none;
}

.btn.is-loading::before {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.btn-link {
    display: inline;
    width: auto;
    height: auto;
    padding: 0;
    font-weight: 600;
    font-size: 14px;
    color: var(--primary);
    background: none;
    box-shadow: none;
}

.btn-link:hover {
    color: var(--primary-light);
    background: none;
    box-shadow: none;
    transform: none;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.btn-link[disabled] {
    color: var(--text-light);
    text-decoration: none;
}

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

/* ---------- Fields ---------- */

.form-grid {
    display: grid;
    gap: 18px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.field-label {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 7px;
}

.field-label label {
    font-size: 13.5px;
    font-weight: 600;
}

.field-label a {
    font-size: 13px;
}

.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrap > .icon {
    position: absolute;
    left: 14px;
    color: var(--text-light);
    pointer-events: none;
    transition: var(--transition);
}

.input-wrap input {
    width: 100%;
    height: 50px;
    padding: 0 14px 0 44px;
    font: inherit;
    color: var(--text);
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    transition: var(--transition);
}

.input-wrap input::placeholder {
    color: var(--text-light);
}

.input-wrap input:hover {
    border-color: #cfd8d5;
}

.input-wrap input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.input-wrap:focus-within > .icon {
    color: var(--primary);
}

.input-wrap input[type="password"],
.input-wrap input.has-toggle {
    padding-right: 48px;
}

.toggle-pass {
    position: absolute;
    right: 6px;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    color: var(--text-muted);
    background: none;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.toggle-pass:hover {
    color: var(--primary);
    background: var(--primary-glow);
}

.toggle-pass .hide,
.toggle-pass.is-visible .show {
    display: none;
}

.toggle-pass.is-visible .hide {
    display: inline;
}

.toggle-pass span {
    display: inline;
    line-height: 0;
}

.field.has-error input {
    border-color: var(--danger);
}

.field.has-error input:focus {
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1);
}

.field-error {
    margin: 6px 0 0;
    font-size: 13px;
    color: var(--danger);
}

.hint {
    margin: 6px 0 0;
    font-size: 12.5px;
    color: var(--text-muted);
}

/* OTP code input */
.code-input input {
    padding-left: 44px;
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.5em;
}

.code-input input::placeholder {
    letter-spacing: 0.5em;
}

/* Strength meter */
.strength {
    margin-top: 8px;
}

.strength .bars {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
}

.strength .bars span {
    height: 4px;
    border-radius: 4px;
    background: var(--border);
    transition: var(--transition);
}

.strength small {
    display: block;
    margin-top: 6px;
    font-size: 12.5px;
    color: var(--text-muted);
}

.strength[data-level="1"] .bars span:nth-child(-n+1) { background: var(--danger); }
.strength[data-level="2"] .bars span:nth-child(-n+2) { background: var(--accent); }
.strength[data-level="3"] .bars span:nth-child(-n+3) { background: var(--primary-light); }
.strength[data-level="4"] .bars span:nth-child(-n+4) { background: var(--success); }

/* Checkbox */
.check {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 14px;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}

.check input {
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: var(--primary);
    cursor: pointer;
}

.form-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}


@media (max-width: 520px) {
    .form-row {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
