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

:root {
    --rose-50:  #fff5f7;
    --rose-100: #ffe4ec;
    --rose-200: #ffc6d6;
    --rose-300: #ff9ebc;
    --rose-400: #f56991;
    --rose-500: #e94e7a;
    --rose-600: #c93a66;
    --lavender: #e9d5f3;
    --peach:    #ffd9c0;
    --mint:     #d4f1e8;
    --gold:     #e8b86b;
}

html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

html {
    position: relative;
    min-height: 100%;
}

body {
    margin-bottom: 60px;
    font-family: 'Quicksand', 'Segoe UI', sans-serif;
    color: #4a2a3a;
    background:
        radial-gradient(circle at 12% 18%, rgba(255, 158, 188, 0.45) 0, transparent 28%),
        radial-gradient(circle at 88% 22%, rgba(233, 213, 243, 0.6) 0, transparent 32%),
        radial-gradient(circle at 18% 88%, rgba(255, 217, 192, 0.55) 0, transparent 30%),
        radial-gradient(circle at 82% 92%, rgba(212, 241, 232, 0.55) 0, transparent 28%),
        linear-gradient(135deg, #fff5f7 0%, #ffe4ec 50%, #f7e6ff 100%);
    background-attachment: fixed;
    min-height: 100vh;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'><g fill='none' stroke='%23ff9ebc' stroke-opacity='0.18' stroke-width='1.2'><circle cx='40' cy='40' r='6'/><path d='M40 28c4 4 4 8 0 12c-4-4-4-8 0-12zM40 52c4-4 4-8 0-12c-4 4-4 8 0 12zM28 40c4-4 8-4 12 0c-4 4-8 4-12 0zM52 40c-4-4-8-4-12 0c4 4 8 4 12 0z'/><circle cx='120' cy='110' r='5'/><path d='M120 100c3 3 3 7 0 10c-3-3-3-7 0-10zM120 120c3-3 3-7 0-10c-3 3-3 7 0 10zM110 110c3-3 7-3 10 0c-3 3-7 3-10 0zM130 110c-3-3-7-3-10 0c3 3 7 3 10 0z'/></g></svg>");
    opacity: 0.6;
}

main, header, footer, .container {
    position: relative;
    z-index: 1;
}

/* === Navbar === */
.navbar {
    background: rgba(255, 245, 247, 0.85) !important;
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(233, 78, 122, 0.15) !important;
    box-shadow: 0 4px 20px rgba(233, 78, 122, 0.08) !important;
}

.navbar-brand {
    font-family: 'Dancing Script', cursive;
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--rose-500), var(--rose-600));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-brand::before {
    content: '✿ ';
    -webkit-text-fill-color: var(--rose-400);
    color: var(--rose-400);
}

.nav-link.text-dark {
    color: var(--rose-600) !important;
    font-weight: 600;
    transition: all 0.2s;
}

.nav-link.text-dark:hover {
    color: var(--rose-400) !important;
    transform: translateY(-1px);
}

/* === Headings === */
h1, .display-6 {
    font-family: 'Dancing Script', cursive;
    color: var(--rose-600);
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* === Form === */
.form-control {
    border: 2px solid var(--rose-200);
    border-radius: 999px;
    padding: 0.75rem 1.25rem;
    background: rgba(255, 255, 255, 0.85);
    transition: all 0.2s;
}

.form-control:focus {
    border-color: var(--rose-400);
    box-shadow: 0 0 0 0.25rem rgba(255, 158, 188, 0.3);
    background: #fff;
}

.input-group-lg > .form-control {
    border-right: none;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.btn-primary {
    background: linear-gradient(135deg, var(--rose-400), var(--rose-500));
    border: none;
    border-radius: 999px;
    padding: 0.75rem 2rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 14px rgba(233, 78, 122, 0.35);
    transition: all 0.2s;
}

.btn-primary:hover, .btn-primary:focus {
    background: linear-gradient(135deg, var(--rose-500), var(--rose-600));
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(233, 78, 122, 0.45);
}

.input-group-lg .btn-primary {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* === Card === */
.card {
    border: none;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(6px);
    box-shadow:
        0 10px 40px rgba(233, 78, 122, 0.12),
        0 2px 8px rgba(233, 78, 122, 0.08);
    overflow: hidden;
}

.card-header {
    background: linear-gradient(135deg, var(--rose-400), var(--rose-500)) !important;
    color: #fff !important;
    border: none;
    padding: 1rem 1.5rem;
    font-weight: 600;
}

.card-header::before {
    content: '❀ ';
}

/* === Result table === */
.table {
    margin-bottom: 0;
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    background: var(--rose-50);
    color: #4a2a3a;
}

.table th {
    color: var(--rose-600);
    font-weight: 600;
    border-bottom: 1px solid var(--rose-100);
}

.table td {
    border-bottom: 1px solid var(--rose-100);
}

/* === Photo === */
.card-body img.rounded {
    border-radius: 16px !important;
    border: 3px solid var(--rose-200) !important;
    box-shadow: 0 4px 16px rgba(233, 78, 122, 0.2);
}

/* === Logo on home === */
.container > .text-center > img.img-fluid {
    filter: drop-shadow(0 8px 20px rgba(233, 78, 122, 0.25));
}

/* === Alert === */
.alert-danger {
    background: linear-gradient(135deg, #ffd9d9, #ffc1c1);
    border: none;
    border-left: 4px solid var(--rose-500);
    border-radius: 16px;
    color: #8a1f3f;
}

/* === Footer === */
.footer {
    background: rgba(255, 245, 247, 0.85);
    backdrop-filter: blur(8px);
    border-top: 1px solid rgba(233, 78, 122, 0.15) !important;
    color: var(--rose-600) !important;
}

.footer a {
    color: var(--rose-500);
    text-decoration: none;
    font-weight: 600;
}

.footer a:hover {
    color: var(--rose-600);
    text-decoration: underline;
}

/* === Pre / JSON === */
pre {
    border-radius: 16px !important;
    background: rgba(255, 245, 247, 0.7) !important;
    border: 1px solid var(--rose-100);
}

details summary {
    cursor: pointer;
    color: var(--rose-500);
    font-weight: 600;
    padding: 0.5rem 0;
}

details summary:hover {
    color: var(--rose-600);
}

/* === PIN login === */
.login-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.login-card {
    width: 100%;
    max-width: 400px;
}

.login-flower {
    font-size: 2.5rem;
    color: var(--rose-400);
    line-height: 1;
}

.pin-dots {
    display: flex;
    justify-content: center;
    gap: 1.1rem;
    margin-bottom: 1.5rem;
}

.pin-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--rose-300);
    background: transparent;
    transition: all 0.15s;
}

.pin-dot.filled {
    background: linear-gradient(135deg, var(--rose-400), var(--rose-500));
    border-color: var(--rose-400);
    box-shadow: 0 2px 8px rgba(233, 78, 122, 0.4);
    transform: scale(1.15);
}

.numpad {
    display: grid;
    grid-template-columns: repeat(3, 72px);
    gap: 0.8rem;
    justify-content: center;
}

.numpad-btn {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 2px solid var(--rose-200);
    background: rgba(255, 255, 255, 0.85);
    color: var(--rose-600);
    font-family: 'Quicksand', sans-serif;
    font-size: 1.6rem;
    font-weight: 600;
    transition: all 0.12s;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.numpad-btn:hover {
    background: var(--rose-100);
    border-color: var(--rose-300);
    transform: translateY(-1px);
}

.numpad-btn:active {
    background: linear-gradient(135deg, var(--rose-400), var(--rose-500));
    border-color: var(--rose-400);
    color: #fff;
    transform: scale(0.94);
}

.numpad-back {
    font-size: 1.3rem;
    color: var(--rose-400);
}

.navbar .logout-form {
    margin: 0;
}

.navbar .btn-logout {
    background: none;
    border: none;
    color: var(--rose-600);
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    transition: all 0.2s;
}

.navbar .btn-logout:hover {
    color: var(--rose-400);
    transform: translateY(-1px);
}

/* === Floating flower decorations === */
.flower-decor {
    position: fixed;
    pointer-events: none;
    z-index: 0;
    opacity: 0.5;
    font-size: 3rem;
    animation: float 6s ease-in-out infinite;
}

.flower-decor.f1 { top: 10%; left: 4%; animation-delay: 0s; }
.flower-decor.f2 { top: 70%; left: 2%; animation-delay: 2s; font-size: 2.2rem; }
.flower-decor.f3 { top: 20%; right: 5%; animation-delay: 4s; font-size: 2.6rem; }
.flower-decor.f4 { top: 80%; right: 4%; animation-delay: 1s; }

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-12px) rotate(8deg); }
}

@media (max-width: 768px) {
    .flower-decor { display: none; }
}
