:root {
    --accent: #0ea5ff;
    --dark: #0f172a;
    /* Main text color */
    --light-text: #f8fafc;
    /* Text for dark mode */
    --wrap-bg: #ffffff;
    --bg1: #eefcff;
    /* New soothing bg */
    --bg2: #f0faff;
    /* New soothing bg */
    --positive: #10b981;
}

body.dark-mode {
    --dark: #cbd5e1;
    /* Main text color in dark mode */
    --wrap-bg: #1e293b;
    --bg1: #0f172a;
    --bg2: #0b1220;
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    font-family: Segoe UI, system-ui, -apple-system, "Helvetica Neue", Arial;
    background: linear-gradient(135deg, var(--bg1), var(--bg2));
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 28px 12px;
    color: var(--dark);
    transition: background-color 0.3s, color 0.3s;
}

.wrap {
    width: 100%;
    max-width: 820px;
    background: var(--wrap-bg);
    border-radius: 14px;
    padding: 20px 20px 28px;
    box-shadow: 0 10px 30px rgba(10, 20, 40, 0.06);
    margin-bottom: 18px;
    text-align: center;
    position: relative;
    /* For positioning the theme toggle */
    transition: background-color 0.3s;
}

.theme-toggle-wrap {
    position: absolute;
    top: 12px;
    right: 12px;
}

#darkModeToggle {
    background: transparent;
    border: none;
    color: var(--dark);
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

h1,
h2 {
    margin: 0 0 8px;
    font-size: 22px
}

h2 {
    font-size: 20px;
    margin-top: 24px;
}

p.lead {
    margin: 0 0 16px;
    font-size: 14px;
    color: #475569;
}

body.dark-mode p.lead {
    color: #94a3b8;
}

.dob-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px
}

select {
    min-width: 92px;
    padding: 10px;
    border-radius: 10px;
    border: 1.2px solid rgba(15, 23, 42, 0.1);
    background: var(--wrap-bg);
    color: var(--dark);
    font-size: 14px;
    appearance: none;
    transition: background-color 0.3s, color 0.3s, border-color 0.2s;
}

select:hover {
    border-color: var(--accent);
}

body.dark-mode select {
    border: 1.2px solid #475569;
}

select:focus {
    outline: 2px solid rgba(14, 165, 255, 0.12)
}

.controls {
    margin-top: 10px
}

button.btn {
    background: var(--accent);
    color: var(--light-text);
    padding: 10px 16px;
    border-radius: 10px;
    border: 0;
    font-weight: 600;
    cursor: pointer
}

button.btn:disabled {
    opacity: .6;
    cursor: not-allowed
}

.loading-row {
    display: none;
    margin-top: 12px;
    color: var(--dark)
}

.result-wrap {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px
}

.age-card {
    width: 100%;
    max-width: 460px;
    border-radius: 14px;
    padding: 18px;
    background: linear-gradient(135deg, #60a5fa, #a78bfa);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 12px 30px rgba(99, 102, 241, 0.14);
    text-align: center
}

.age-big {
    font-size: 42px;
    line-height: 1;
    margin: 0
}

.age-sub {
    font-size: 16px;
    font-weight: 600;
    margin-top: 10px
}

.result-card-plain {
    width: 100%;
    max-width: 460px;
    border-radius: 12px;
    padding: 14px;
    background: linear-gradient(135deg, #fff1b8, #fed7aa);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.06);
    text-align: center;
    color: #57450c;
}

.result-card-plain div {
    margin-top: 6px
}

.share-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 10px
}

.share-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #000;
    color: #fff;
    border: 0;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(2, 6, 23, 0.12)
}

.download-btn {
    padding: 8px 12px;
    border-radius: 10px;
    background: var(--positive);
    color: #fff;
    border: 0;
    font-weight: 700;
    cursor: pointer
}

.content-section {
    margin: 32px auto 0;
    max-width: 700px;
    text-align: left;
    line-height: 1.6;
    color: #334155;
}

body.dark-mode .content-section {
    color: #94a3b8;
}

.content-section h2 {
    text-align: center;
    margin-bottom: 16px;
}

.content-section p,
.content-section ul {
    margin-bottom: 12px;
}

footer {
    width: 100%;
    text-align: center;
    margin-top: 8px;
    font-size: 13px;
    color: #475569
}

body.dark-mode footer {
    color: #94a3b8;
}

footer a {
    color: var(--accent);
    text-decoration: none
}

.toast {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 22px;
    background: #111;
    color: #fff;
    padding: 9px 14px;
    border-radius: 9px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s
}

.toast.show {
    opacity: 1
    }

/* Styles for the new contact form */
.contact-form {
    margin-top: 24px;
    text-align: left;
}
.form-group {
    margin-bottom: 16px;
}
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}
.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: 1.2px solid rgba(15, 23, 42, 0.1);
    background: var(--bg1);
    color: var(--dark);
    font-size: 14px;
    font-family: inherit;
}
body.dark-mode .form-group input,
body.dark-mode .form-group textarea {
    border: 1.2px solid #475569;
}
.form-group button.btn {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    }

/* Style for the "Made in India" section on about page */
.made-in-india {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid rgba(15, 23, 42, 0.1);
}

body.dark-mode .made-in-india {
    border-top-color: #475569;
}

.made-in-india h3 {
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    color: var(--dark);
}

/* Styles for the PWA install instruction box */
.install-instructions {
    display: none; /* Hidden by default */
    max-width: 460px;
    width: 100%;
    margin-top: 16px;
    padding: 14px;
    border: 1px solid #a5b4fc;
    background-color: #eef2ff;
    border-radius: 12px;
    text-align: left;
    font-size: 14px;
    color: #4338ca;
}

body.dark-mode .install-instructions {
    border-color: #4f46e5;
    background-color: #312e81;
    color: #c7d2fe;
}

.install-instructions p {
    margin: 0;
    line-height: 1.5;
}

.install-instructions i {
    margin-right: 8px;
    }
