* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    font-family: Inter, Arial, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(100, 80, 255, 0.16), transparent 35%),
        radial-gradient(circle at bottom right, rgba(0, 220, 180, 0.10), transparent 35%),
        #090b13;
    color: #f5f7ff;
}

button,
input,
textarea {
    font: inherit;
}

button {
    border: 0;
    cursor: pointer;
}

/* =========================
   HEADER
========================= */

.topbar {
    min-height: 72px;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 18px;
    background: rgba(18, 20, 35, 0.96);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 8px 30px rgba(0,0,0,0.22);
    position: sticky;
    top: 0;
    z-index: 100;
}

.back-btn {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: white;
    text-decoration: none;
    background: rgba(255,255,255,0.07);
    font-size: 22px;
}

.brand {
    flex: 1;
    text-align: center;
    font-size: 26px;
    font-weight: 800;
}

.profile-mini {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 110px;
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #6c63ff, #00c9a7);
    font-weight: 800;
}

.profile-mini span {
    font-weight: 600;
}

/* =========================
   PAGE
========================= */

.ai-page {
    width: min(1050px, calc(100% - 32px));
    margin: 35px auto 60px;
}

/* =========================
   HERO
========================= */

.ai-hero {
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 28px;
    margin-bottom: 24px;
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 24px;
    background: rgba(255,255,255,0.045);
    backdrop-filter: blur(18px);
}

.ai-icon {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 20px;
    background: rgba(108,99,255,0.18);
    font-size: 38px;
}

.ai-hero > div:last-child > span,
.section-heading > span,
.result-header > div > span {
    color: #8f88ff;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1.5px;
}

.ai-hero h1 {
    margin: 6px 0;
    font-size: clamp(27px, 5vw, 42px);
}

.ai-hero p {
    max-width: 700px;
    color: #aeb4c8;
    line-height: 1.6;
}

/* =========================
   CARD
========================= */

.routine-card,
.loading-card,
.routine-result,
.ai-info {
    padding: 28px;
    margin-bottom: 24px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 22px;
    background: rgba(255,255,255,0.045);
    backdrop-filter: blur(18px);
}

.section-heading {
    margin-bottom: 25px;
}

.section-heading h2 {
    margin-top: 5px;
    font-size: 25px;
}

/* =========================
   FORM
========================= */

.form-group {
    margin-bottom: 22px;
}

.form-group label {
    display: block;
    margin-bottom: 9px;
    font-weight: 700;
    color: #e8ebf7;
}

textarea,
input[type="time"] {
    width: 100%;
    border: 1px solid rgba(255,255,255,0.09);
    outline: none;
    border-radius: 14px;
    padding: 14px 15px;
    color: white;
    background: rgba(0,0,0,0.18);
    transition: 0.2s;
}

textarea {
    min-height: 105px;
    resize: vertical;
}

input[type="time"] {
    min-height: 50px;
}

textarea:focus,
input[type="time"]:focus {
    border-color: rgba(108,99,255,0.75);
    box-shadow: 0 0 0 3px rgba(108,99,255,0.10);
}

textarea::placeholder {
    color: #777d92;
}

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

/* =========================
   OPTIONS
========================= */

.option-grid,
.energy-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.energy-grid {
    grid-template-columns: repeat(3, 1fr);
}

.option-btn,
.energy-btn {
    padding: 14px 10px;
    border-radius: 13px;
    color: #bfc5d8;
    background: rgba(255,255,255,0.055);
    border: 1px solid rgba(255,255,255,0.07);
    transition: 0.2s;
}

.option-btn:hover,
.energy-btn:hover,
.option-btn.active,
.energy-btn.active {
    color: white;
    border-color: rgba(108,99,255,0.7);
    background: rgba(108,99,255,0.16);
}

/* =========================
   GENERATE
========================= */

.generate-btn {
    width: 100%;
    padding: 16px;
    border-radius: 15px;
    color: white;
    font-weight: 800;
    background: linear-gradient(135deg, #6c63ff, #5148db);
    box-shadow: 0 12px 30px rgba(108,99,255,0.22);
    transition: 0.2s;
}

.generate-btn:hover {
    transform: translateY(-2px);
}

/* =========================
   LOADING
========================= */

.hidden {
    display: none !important;
}

.loading-card {
    text-align: center;
}

.loader {
    font-size: 42px;
    margin-bottom: 10px;
    animation: float 1.2s ease-in-out infinite;
}

.loading-card p {
    margin-top: 7px;
    color: #9ca3b8;
}

@keyframes float {
    50% {
        transform: translateY(-7px);
    }
}

/* =========================
   RESULT
========================= */

.result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 22px;
}

.result-header h2 {
    margin-top: 5px;
}

.secondary-btn {
    padding: 11px 15px;
    border-radius: 11px;
    color: white;
    background: rgba(255,255,255,0.07);
}

.routine-list {
    display: grid;
    gap: 12px;
}

.routine-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 16px;
    border-radius: 15px;
    background: rgba(255,255,255,0.045);
    border: 1px solid rgba(255,255,255,0.06);
}

.routine-time {
    min-width: 75px;
    color: #8f88ff;
    font-weight: 800;
}

.routine-info {
    flex: 1;
}

.routine-info h3 {
    font-size: 16px;
    margin-bottom: 4px;
}

.routine-info p {
    color: #9299ad;
    font-size: 13px;
}

.accept-btn {
    width: 100%;
    margin-top: 20px;
    padding: 15px;
    border-radius: 14px;
    color: white;
    font-weight: 800;
    background: linear-gradient(135deg, #00b894, #00a383);
}

/* =========================
   INFO
========================= */

.ai-info {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.ai-info > div:first-child {
    font-size: 30px;
}

.ai-info h3 {
    margin-bottom: 5px;
}

.ai-info p {
    color: #9da4b8;
    line-height: 1.6;
}

/* =========================
   MOBILE
========================= */

@media (max-width: 700px) {

    .topbar {
        padding: 10px 14px;
    }

    .brand {
        font-size: 20px;
    }

    .profile-mini span {
        display: none;
    }

    .ai-page {
        width: min(100% - 20px, 1050px);
        margin-top: 20px;
    }

    .ai-hero,
    .routine-card,
    .loading-card,
    .routine-result,
    .ai-info {
        padding: 20px;
    }

    .ai-hero {
        align-items: flex-start;
    }

    .ai-icon {
        width: 55px;
        height: 55px;
        font-size: 28px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .option-grid {
        grid-template-columns: 1fr 1fr;
    }

    .energy-grid {
        grid-template-columns: 1fr;
    }

    .result-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .routine-item {
        align-items: flex-start;
    }

    .routine-time {
        min-width: 62px;
    }

}
select {
    width: 100%;
    min-height: 50px;

    padding: 14px 15px;

    border:
        1px solid rgba(255,255,255,0.09);

    border-radius: 14px;

    color: white;

    background: #111522;

    outline: none;
}