/* ============================================================
   GENTLY WELLNESS APP
   Created by Miyuki Boulware
===============================================================

STYLESHEET ORGANIZATION
1. Reusable variables
2. Basic reset and page layout
3. Shared screen system
4. Splash animation
5. Welcome and onboarding layouts
6. Buttons
7. Forms
8. Social sign-in icons
9. Accessibility
10. Responsive adjustments

DESIGN APPROACH
The variables and reusable classes make it easier to use this file
as a starting point for another mobile-style web application.
============================================================ */

/* ============================================================
   1. REUSABLE DESIGN VARIABLES
============================================================ */

/*
CSS custom properties store colors and fonts in one place.
Changing one value here updates every place that uses the variable.
*/
:root {
    --background-color: #061713;
    --input-color: #010806;
    --primary-text-color: #d4e6e4;
    --secondary-text-color: #95a19f;
    --accent-color: #49c8bd;
    --gold-color: #d8c98e;
    --gold-dark-color: #cdbd80;
    --border-color: #879694;
    --error-color: #f1a7a7;
    --heading-font: Georgia, "Times New Roman", serif;
    --body-font: Arial, Helvetica, sans-serif;
}

/* ============================================================
   2. BASIC RESET AND PAGE LAYOUT
============================================================ */

/*
box-sizing: border-box makes width and height calculations easier.
Padding and borders are included inside the assigned dimensions.
*/
* {
    box-sizing: border-box;
}

/* Keeps the dark background visible even if content is short. */
html {
    min-height: 100%;
    background-color: var(--background-color);
}

/*
The body uses the application's main background, text color,
font family, and readable line spacing.
*/
body {
    min-height: 100vh;
    margin: 0;
    background-color: var(--background-color);
    color: var(--primary-text-color);
    font-family: var(--body-font);
    line-height: 1.5;
}

/*
On phones, app-container fills the available width.
The maximum width keeps the interface close to a mobile app size.
*/
.app-container {
    width: min(100%, 430px);
    min-height: 100vh;
    margin: 0 auto;
    overflow: hidden;
    background-color: var(--background-color);
}

/* Shared heading style used across all screens. */
h1 {
    margin: 0;
    font-family: var(--heading-font);
    font-size: clamp(2.55rem, 10.5vw, 4rem);
    font-weight: 500;
    line-height: 1.08;
}

/* Makes form controls inherit the application's font. */
button,
input {
    font: inherit;
}

/* ============================================================
   3. SHARED SCREEN SYSTEM
============================================================ */

/*
Every app page is a section with class="app-screen."
Screens are hidden by default.
JavaScript adds the active class to the screen being shown.
*/
.app-screen {
    display: none;
    min-height: 100vh;
    padding: 42px 24px 30px;
}

/*
The active screen becomes a vertical flex container.
This makes it easy to center and space content.
*/
.app-screen.active {
    display: flex;
    flex-direction: column;
}

/* ============================================================
   4. SPLASH SCREEN AND BREATHING ANIMATION
============================================================ */

/* Centers the animated splash artwork in the available space. */
#splashScreen {
    align-items: center;
    justify-content: center;
    text-align: center;
}

/*
The splash-art div is a positioning container.
The orb and logo overlap inside the same grid area.
*/
.splash-art {
    position: relative;
    display: grid;
    width: min(105vw, 470px);
    aspect-ratio: 390 / 660;
    place-items: center;
}

/*
The orb fills the splash area and performs one six-second
breathing cycle before JavaScript changes screens.
*/
.green-orb {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transform-origin: center;
    animation: orb-breathing 6s ease-in-out forwards;
}

/*
The logo sits above the orb.
It begins invisible and softly appears shortly after page load.
*/
.splash-logo {
    position: relative;
    z-index: 1;
    width: 46%;
    max-width: 190px;
    opacity: 0;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.25));
    animation: logo-fade-in 1.2s ease-out 300ms forwards;
}

/*
The breathing animation:
- Starts slightly smaller
- Slowly expands
- Briefly holds
- Gently contracts
*/
@keyframes orb-breathing {
    0% {
        transform: scale(0.94);
        opacity: 0.72;
    }

    45% {
        transform: scale(1.04);
        opacity: 0.98;
    }

    60% {
        transform: scale(1.04);
        opacity: 0.98;
    }

    100% {
        transform: scale(0.96);
        opacity: 0.8;
    }
}

/* Soft entrance animation for the Gently logo. */
@keyframes logo-fade-in {
    from {
        opacity: 0;
        transform: scale(0.96);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ============================================================
   5. WELCOME AND ONBOARDING SCREENS
============================================================ */

/*
This shared layout is used by:
- Welcome
- Reduce Anxiety
- Meditate
- Enhance Focus
*/
.onboarding-screen {
    position: relative;
    align-items: center;
    justify-content: space-between;
    text-align: center;
}

/* Positions onboarding Back buttons toward the upper-left area. */
.onboarding-back {
    align-self: flex-start;
    margin-bottom: -22px;
}

/* Prevents long headings from becoming too wide. */
.onboarding-title {
    max-width: 360px;
    margin-bottom: 18px;
    /* margin-bottom: 22px; for more space. */
}

/*
Keeps all onboarding illustrations visually consistent while
allowing them to scale down on smaller screens.
*/
.onboarding-illustration {
    width: min(96%, 365px);
    max-height: 465px;
    /* margin: 8px auto 0; */
    margin: -8px 0;
    /* margin: -12px auto 0; a negative top margin moves the image upward. */
    object-fit: contain;
}

/* Shared paragraph style below each onboarding illustration. */
.onboarding-message {
    max-width: 310px;
    /* margin: 0 auto 18px; */
    margin: 0 auto 30px; /* increased the spacing above the begin button. */
    /* font-size: 1.16rem; */
    font-size: 1.05rem; /* make the description text about 5-6% smaller. */
}

/*
Elements marked screen-reveal begin invisible.
jQuery changes their opacity after each screen appears.
*/
.screen-reveal {
    opacity: 0;
}

/*
Illustrations also begin slightly lower.
JavaScript gradually moves them upward while fading them in.
*/
.onboarding-illustration.screen-reveal {
    transform: translateY(22px);
}

/* ============================================================
   6. BUTTONS
============================================================ */

/*
Both primary and secondary buttons share the same overall size,
rounded corners, and pointer cursor.
*/
.primary-button,
.secondary-button {
    width: 100%;
    min-height: 62px;
    border-radius: 18px;
    cursor: pointer;
}

/*
Primary buttons use the gold gradient from the original design.
Inset shadows create a softly raised appearance.
*/
.primary-button {
    border: 2px solid #f7f3df;
    background: linear-gradient(
        var(--gold-color),
        var(--gold-dark-color)
    );
    box-shadow:
        inset 0 2px 5px rgba(255, 255, 255, 0.75),
        inset 0 -5px 6px rgba(93, 75, 32, 0.28);
    color: #07110f;
    font-size: 1.32rem;
    transition:
        transform 220ms ease,
        filter 220ms ease;
}

/* Small desktop hover effect for clickable feedback. */
.primary-button:hover {
    transform: translateY(-1px);
    filter: brightness(1.03);
}

/*
Secondary button matches the outlined Log In button from the
original mobile design.
*/
.secondary-button {
    margin-top: 14px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--primary-text-color);
    font-size: 1.05rem;
}

/*
Text-link buttons are useful for less prominent actions,
such as switching between Log In and Create Account.
*/
.text-link-button {
    margin-top: 12px;
    padding: 8px;
    border: 0;
    background: transparent;
    color: var(--primary-text-color);
    cursor: pointer;
}

.text-link-button strong {
    color: var(--accent-color);
}

/* ============================================================
   7. FORMS
============================================================ */

/*
Form screens can scroll vertically if a phone is too short
to display all fields at once.
*/
.form-screen {
    gap: 20px;
    overflow-y: auto;
}

/* Groups each form page heading and introductory paragraph. */
.form-heading {
    display: grid;
    gap: 8px;
}

.form-heading p {
    margin: 0;
    color: var(--secondary-text-color);
}

/*
Back buttons use a visible arrow.
The HTML aria-label describes the destination for screen readers.
*/
.back-button {
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--primary-text-color);
    font-size: 2rem;
    cursor: pointer;
}

/* Forms use CSS Grid to create even vertical spacing. */
#accountForm,
#loginForm {
    display: grid;
    gap: 15px;
}

/*
First and last name appear next to each other on wider phones.
A later media query stacks them on very narrow screens.
*/
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/*
Each field has its own dark rounded container.
The label and input are stacked inside it.
*/
.form-field {
    position: relative;
    display: grid;
    gap: 2px;
    min-height: 82px;
    padding: 13px 17px 11px;
    border-radius: 16px;
    background-color: var(--input-color);
}

/* Labels use a softer color to create visual hierarchy. */
.form-field label {
    color: var(--secondary-text-color);
    font-family: var(--heading-font);
    font-weight: 600;
}

/*
The actual input border and background are removed because
the surrounding form-field div already creates the field shape.
*/
.form-field input {
    width: 100%;
    padding: 2px 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--primary-text-color);
    font-size: 1.12rem;
}

/* Highlights the whole field container when its input is active. */
.form-field:focus-within {
    outline: 1px solid var(--accent-color);
}

/* Leaves room for the Show/Hide button inside password fields. */
.password-field input {
    padding-right: 60px;
}

/* Positions the Show/Hide button inside a password field. */
.show-password-button {
    position: absolute;
    right: 15px;
    bottom: 18px;
    border: 0;
    background: transparent;
    color: var(--secondary-text-color);
    cursor: pointer;
}

/*
Validation paragraphs keep a small height even when empty.
This prevents the form from jumping when a message appears.
*/
.form-message {
    min-height: 22px;
    margin: -4px 0 0;
    color: var(--error-color);
}

/*
Displays a small informational note below the Create Account button.

This lets users know the application is a portfolio prototype.
Any information entered remains on the user's device and is not
transmitted to a server.
*/
.prototype-note {
    margin-top: 12px;
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--secondary-text-color);
    text-align: center;
}

/* ============================================================
   8. SOCIAL SIGN-IN OPTIONS
============================================================ */

.social-heading {
    margin: -4px 0 -6px;
    color: var(--secondary-text-color);
    text-align: center;
}

/* Places Facebook, Google, and Apple buttons in three columns. */
.social-login-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

/*
Each icon sits inside a large touch-friendly button.
The buttons are demonstrations and do not contact real providers.
*/
.social-login-button {
    display: grid;
    min-height: 58px;
    padding: 12px;
    place-items: center;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background-color: transparent;
    cursor: pointer;
    transition:
        transform 220ms ease,
        background-color 220ms ease,
        border-color 220ms ease;
}

.social-login-button:hover {
    transform: translateY(-2px);
    border-color: var(--accent-color);
    background-color: rgba(73, 200, 189, 0.08);
}

/* Keeps all provider icons at the same visual size. */
.social-login-button img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

/*
The divider creates two horizontal lines with text in the middle.
Pseudo-elements are used so no extra HTML lines are needed.
*/
.account-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--secondary-text-color);
    font-size: 0.9rem;
}

.account-divider::before,
.account-divider::after {
    flex: 1;
    height: 1px;
    background-color: rgba(135, 150, 148, 0.45);
    content: "";
}

/* ============================================================
   9. ACCESSIBILITY
============================================================ */

/*
Adds a visible outline for users navigating with a keyboard.
:focus-visible avoids showing the outline for normal mouse clicks.
*/
button:focus-visible,
input:focus-visible {
    outline: 3px solid var(--accent-color);
    outline-offset: 3px;
}

/*
If a user has enabled "Reduce Motion" in their device settings,
animations are removed and hidden content becomes visible.
*/
@media (prefers-reduced-motion: reduce) {
    .green-orb,
    .splash-logo {
        animation: none;
        opacity: 1;
        transform: none;
    }

    .screen-reveal {
        opacity: 1;
        transform: none;
    }
}

/* ============================================================
   10. RESPONSIVE ADJUSTMENTS
============================================================ */

/*
On very narrow devices, first and last name fields stack
instead of becoming too small side by side.
*/
@media screen and (max-width: 360px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/*
On tablets and desktop screens, the application is displayed
inside a centered rounded panel that resembles a mobile app.
*/
@media screen and (min-width: 700px) {
    body {
        display: grid;
        place-items: center;
        padding: 36px 20px;
    }

    .app-container {
        min-height: 820px;
        border: 1px solid rgba(212, 230, 228, 0.22);
        border-radius: 38px;
        box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
    }

    .app-screen {
        min-height: 820px;
    }
}
