/* =========================================================
   SIGNUP STYLESHEET (full, minimal white theme + floating labels)
   Target: frontend/views/auth/signup.php
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Khmer:wght@400;500;600&display=swap');

/* ===== Reset / Base ===== */
* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    font-family: 'Noto Sans Khmer', 'Khmer OS Siemreap', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    background: #ffffff;
    color: #1b1b33;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.45;
}

/* ===== Container & Card ===== */
.wrap {
    width: 100%;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card {
    background: #fff;
    border: 1px solid #e8eaf5;
    border-radius: 16px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .06);
    width: 100%;
    max-width: 720px;
    padding: 22px 20px;
    animation: fadeIn .5s ease;
}

/* ===== Headings ===== */
.title {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin: 0 0 4px;
}

.subtitle {
    text-align: center;
    color: #61647a;
    margin: 0 0 18px;
    font-size: .95rem;
}

/* ===== Grid ===== */
.grid {
    display: grid;
    gap: 14px;
    grid-template-columns: 1fr;
}

@media (min-width: 720px) {
    .grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* ===== Fields & Inputs ===== */
.field {
    text-align: left;
}

.control {
    position: relative;
}

/* Inputs (white, subtle border) */
.input {
    width: 100%;
    padding: 12px 14px;
    font-size: 14.5px;
    border: 1px solid #cbd3ff;
    border-radius: 10px;
    background: #fff;
    color: #111;
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.input:hover {
    border-color: #aebaff;
}

.input:focus {
    border-color: #4a68ff;
    box-shadow: 0 0 0 3px rgba(74, 104, 255, .14);
}

/* ===== Floating label: consistent, readable, accessible ===== */
.flabel {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    padding: 0 6px;
    font-size: 14px;
    line-height: 1;
    color: #6b6f86;
    /* muted default */
    background: #fff;
    /* chip to avoid overlap on white inputs */
    pointer-events: none;
    border-radius: 4px;
    transition: top .16s ease, transform .16s ease, font-size .16s ease, color .16s ease, background .16s ease;
}

/* Float when focused or when JS adds .is-filled */
.control.is-focused .flabel,
.control.is-filled .flabel,
.control:focus-within .flabel {
    top: -10px;
    transform: none;
    font-size: 12px;
    color: #4a68ff;
    /* match focus ring */
    background: #fff;
    font-weight: 600;
}

/* Error state hooks */
.field.error .input {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, .15) !important;
}

.field.error .flabel {
    color: #b91c1c !important;
}

/* Optional required asterisk inside label text */
.flabel .req {
    color: #dc2626;
    margin-left: 4px;
    font-weight: 700;
    font-size: 12px;
}

/* ===== Trailing password-eye button ===== */
.with-trailing {
    padding-right: 44px;
}

.trailing {
    position: absolute;
    right: 10px;
    top: 8px;
}

.trailing button {
    border: none;
    background: transparent;
    padding: 6px;
    color: #6b6f86;
    cursor: pointer;
    border-radius: 8px;
}

.trailing button:hover {
    background: #f3f4f6;
}

/* ===== Password strength meter ===== */
.meter {
    height: 8px;
    border-radius: 999px;
    background: #eef2f7;
    overflow: hidden;
    margin-top: 8px;
}

.meter>span {
    display: block;
    height: 100%;
    width: 0%;
    transition: width .25s;
}

.weak {
    background: #ef4444;
}

.ok {
    background: #f59e0b;
}

.good {
    background: #22c55e;
}

.match-text {
    font-size: 12px;
    margin-top: 6px;
}

.match-yes {
    color: #16a34a;
}

.match-no {
    color: #dc2626;
}

/* ===== Avatar (optional) ===== */
.avatar-grid {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 16px;
    align-items: center;
    padding: 10px;
    border: 1px dashed #e5e7eb;
    border-radius: 14px;
    background: #fafafa;
}

@media (max-width: 520px) {
    .avatar-grid {
        grid-template-columns: 1fr;
    }
}

.avatar-chip {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    background: #fff;
    display: grid;
    place-items: center;
}

.avatar-chip img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===== Actions ===== */
.actions {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    border: 1px solid transparent;
    transition: transform .06s ease, box-shadow .25s ease, background .25s ease;
    min-width: 240px;
    justify-content: center;
}

.btn-primary {
    background: #4a68ff;
    color: #fff;
    border-color: #4a68ff;
    box-shadow: 0 4px 10px rgba(74, 104, 255, .28);
}

.btn-primary:hover {
    background: #3d57da;
    border-color: #3d57da;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(74, 104, 255, .32);
}

.underlink {
    text-decoration: none;
    color: #2a4fff;
    font-weight: 700;
}

/* ===== Errors block ===== */
.errors {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

.error {
    background: #fff5f5;
    border: 1px solid #ffcdcd;
    color: #a30000;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 14px;
    text-align: left;
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}