/*
Theme Name: Centhian
Theme URI: https://example.com
Author: Centhian
Author URI: https://example.com
Description: Custom futuristic SaaS landing page theme for Centhian with inline login and registration.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: custom-theme
*/

:root {
    --color-bg:           #ffffff;
    --color-text:         #0f0f0f;
    --color-muted:        #6b7280;
    --color-border:       #e5e7eb;
    --color-indigo:       #4F46E5;
    --color-indigo-dark:  #3730a3;
    --color-indigo-light: #eef2ff;
    --color-dark:         #0f0f0f;
    --color-dark-header:  #0a0a0a;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-bg);
}

a {
    color: var(--color-indigo);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--color-indigo-dark);
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ── Layout ── */
.site {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-content {
    flex: 1;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ── Header ── */
.site-header {
    background-color: var(--color-dark-header);
    color: #fff;
    padding: 1rem 0;
    border-bottom: 2px solid var(--color-indigo);
    position: relative;
    z-index: 10;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.site-branding .site-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.site-branding .site-title a {
    color: #fff;
    transition: color 0.2s;
}

.site-branding .site-title a:hover {
    color: var(--color-indigo);
    text-decoration: none;
}

.site-branding .site-description {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.45);
    margin-top: 0.15rem;
}

/* ── Navigation ── */
.main-navigation ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.main-navigation a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    transition: color 0.2s;
}

.main-navigation a:hover {
    color: var(--color-indigo);
    text-decoration: none;
}

/* ── Hero Section ── */
.hero-section {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 66px);
    padding: 5rem 1.5rem;
    background-color: var(--color-bg);
    text-align: center;
    overflow: hidden;
}

/* Particle canvas sits behind everything */
#hero-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.hero-inner {
    position: relative;
    z-index: 1;
    max-width: 680px;
    width: 100%;
}

/* ── Entrance animation ── */
@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

.hero-brand,
.hero-headline,
.hero-subheading {
    opacity: 0;
    animation: fadeSlideUp 0.65s ease forwards;
}

.hero-brand      { animation-delay: 0.1s; }
.hero-headline   { animation-delay: 0.3s; }
.hero-subheading { animation-delay: 0.5s; }

/* ── Hero Brand label ── */
.hero-brand {
    display: inline-block;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--color-indigo);
    margin-bottom: 1.75rem;
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* ── Headline ── */
.hero-headline {
    font-size: clamp(2rem, 5vw, 3.25rem);
    font-weight: 800;
    line-height: 1.2;
    color: var(--color-dark);
    margin-bottom: 1.25rem;
    letter-spacing: -0.02em;
    min-height: 1.2em;
}

/* Blinking cursor */
.typed-cursor {
    display: inline-block;
    width: 3px;
    height: 0.9em;
    background-color: var(--color-indigo);
    vertical-align: middle;
    margin-left: 4px;
    border-radius: 1px;
    animation: cursorBlink 1s step-end infinite;
}

@keyframes cursorBlink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

/* ── Subheading ── */
.hero-subheading {
    font-size: 1.125rem;
    color: var(--color-muted);
    max-width: 520px;
    margin: 0 auto 2.5rem;
    line-height: 1.7;
}

/* ── CTA Button ── */
@keyframes glowPulse {
    0%,  100% { box-shadow: 0 0 12px 2px rgba(79, 70, 229, 0.45); }
    50%        { box-shadow: 0 0 28px 8px rgba(79, 70, 229, 0.75); }
}

/* .btn-login base styles — animation handled by .login-morph which is always co-applied */
.btn-login {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ── Main content ── */
.site-main {
    padding: 3rem 0;
}

/* ── Posts ── */
.post {
    margin-bottom: 3rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid var(--color-border);
}

.post:last-child {
    border-bottom: none;
}

.entry-header .entry-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    color: var(--color-dark);
}

.entry-header .entry-title a {
    color: var(--color-dark);
    transition: color 0.2s;
}

.entry-header .entry-title a:hover {
    color: var(--color-indigo);
    text-decoration: none;
}

.entry-meta {
    font-size: 0.85rem;
    color: var(--color-muted);
    margin-bottom: 1rem;
}

.entry-content {
    line-height: 1.75;
}

.entry-content p {
    margin-bottom: 1.25rem;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
    color: var(--color-dark);
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
}

.entry-content a {
    color: var(--color-indigo);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.entry-content a:hover {
    color: var(--color-indigo-dark);
}

/* ── Footer ── */
.site-footer {
    background-color: var(--color-dark-header);
    color: rgba(255, 255, 255, 0.45);
    padding: 1.5rem 0;
    font-size: 0.875rem;
    text-align: center;
    border-top: 2px solid var(--color-indigo);
}

.site-footer a {
    color: var(--color-indigo);
}

.site-footer a:hover {
    color: #818cf8;
    text-decoration: none;
}

/* ── Inline Login / Register Morph ── */

.login-morph-wrapper {
    display: flex;
    justify-content: center;
}

.login-morph {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-indigo);
    color: #fff;
    border: none;
    border-radius: 8px;
    width: 148px;
    max-height: 52px;
    padding: 0 2.5rem;
    cursor: pointer;
    overflow: hidden;
    transition:
        width         0.4s cubic-bezier(0.4, 0, 0.2, 1),
        max-height    0.5s cubic-bezier(0.4, 0, 0.2, 1),
        border-radius 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        background-color 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow    0.35s cubic-bezier(0.4, 0, 0.2, 1),
        padding       0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeSlideUp 0.55s ease 0.7s both, glowPulse 2.5s ease-in-out 1.45s infinite;
}

.login-morph.expanded {
    background-color: #ffffff;
    border-radius: 20px;
    width: 380px;
    max-height: 640px;
    padding: 2rem 2.25rem 1.75rem;
    box-shadow:
        0 8px 40px rgba(79, 70, 229, 0.14),
        0 2px 16px rgba(79, 70, 229, 0.08),
        0 0 0 1.5px rgba(79, 70, 229, 0.18);
    cursor: default;
    animation: none;
    overflow: visible;
}

/* Collapsed "Log In" label */
.morph-label {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
    transition: opacity 0.15s ease, transform 0.15s ease;
    position: absolute;
    pointer-events: none;
    color: #fff;
}
.login-morph.expanded .morph-label {
    opacity: 0;
    transform: scale(0.85);
}

/* ✕ Close */
.morph-close {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    background: none;
    border: none;
    font-size: 1rem;
    color: #c4c4cf;
    cursor: pointer;
    line-height: 1;
    padding: 0.3rem 0.4rem;
    border-radius: 5px;
    opacity: 0;
    transition: opacity 0.2s ease 0.25s, color 0.15s;
    pointer-events: none;
}
.morph-close:hover { color: var(--color-muted); }
.login-morph.expanded .morph-close {
    opacity: 1;
    pointer-events: auto;
}

/* Inner content wrapper */
.morph-content {
    width: 100%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
.login-morph.expanded .morph-content {
    opacity: 1;
    pointer-events: auto;
    transition-delay: 0.22s;
}

/* ── Mode tabs ── */
.morph-tabs {
    display: flex;
    border-bottom: 1.5px solid var(--color-border);
    margin-bottom: 1.4rem;
    gap: 0;
}
.morph-tab {
    flex: 1;
    background: none;
    border: none;
    padding: 0.55rem 0;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1.5px;
    transition: color 0.2s, border-color 0.2s;
}
.morph-tab--active {
    color: var(--color-indigo);
    border-bottom-color: var(--color-indigo);
}

/* ── Panel switch ── */
.morph-panel {
    transition: opacity 0.18s ease;
    opacity: 1;
}
.morph-panel--hidden {
    display: none;
}

/* ── Inline message (error / success) ── */
.morph-msg {
    font-size: 0.8rem;
    text-align: center;
    min-height: 1.1em;
    margin-bottom: 0.6rem;
    border-radius: 6px;
    transition: opacity 0.2s;
}
.morph-msg--error {
    color: #dc2626;
    background: #fef2f2;
    padding: 0.45rem 0.75rem;
}
.morph-msg--success {
    color: #059669;
    background: #ecfdf5;
    padding: 0.45rem 0.75rem;
}

/* ── Form fields ── */
.morph-field {
    margin-bottom: 1.1rem;
}
.morph-field label {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-muted);
    margin-bottom: 0.4rem;
}
.morph-field input {
    width: 100%;
    padding: 0.45rem 0;
    border: none;
    border-bottom: 1.5px solid var(--color-border);
    border-radius: 0;
    font-size: 0.95rem;
    color: var(--color-dark);
    background: transparent;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.morph-field input::placeholder { color: #c4c4cf; }
.morph-field input:focus        { border-bottom-color: var(--color-indigo); }

/* Inline field error (password mismatch etc.) */
.morph-field-error {
    display: block;
    font-size: 0.72rem;
    color: #dc2626;
    margin-top: 0.3rem;
    min-height: 1em;
}

/* ── Submit button ── */
.morph-submit {
    display: block;
    width: 100%;
    padding: 0.8rem;
    margin-top: 0.5rem;
    background-color: var(--color-indigo);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
    animation: glowPulse 2.5s ease-in-out infinite;
    transition: background-color 0.2s, transform 0.2s, opacity 0.2s;
}
.morph-submit:hover    { background-color: var(--color-indigo-dark); transform: scale(1.02); }
.morph-submit:disabled { cursor: not-allowed; }

/* ── Forgot password link ── */
.morph-forgot {
    display: block;
    text-align: center;
    font-size: 0.8rem;
    color: #c4c4cf;
    margin-top: 0.85rem;
    text-decoration: none;
    transition: color 0.2s;
}
.morph-forgot:hover { color: var(--color-muted); text-decoration: none; }

/* ── Registration success state ── */
.morph-success-state {
    text-align: center;
    padding: 1.5rem 0 0.5rem;
    color: var(--color-indigo);
}
.morph-success-state svg {
    width: 2.5rem;
    height: 2.5rem;
    stroke: var(--color-indigo);
    margin: 0 auto 0.85rem;
    display: block;
}
.morph-success-state p {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.5;
    color: var(--color-dark);
}

/* ── Welcome page ── */
.welcome-section .hero-headline { font-size: clamp(1.75rem, 4vw, 2.75rem); }
.welcome-name { color: var(--color-indigo); }

.btn-logout {
    display: inline-block;
    padding: 0.8rem 2.25rem;
    background-color: var(--color-indigo);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    border-radius: 8px;
    text-decoration: none;
    animation: glowPulse 2.5s ease-in-out infinite;
    transition: background-color 0.2s, transform 0.2s;
}
.btn-logout:hover {
    background-color: var(--color-indigo-dark);
    color: #fff;
    transform: scale(1.03);
    text-decoration: none;
}

/* ── Pagination ── */
.navigation.pagination {
    margin-top: 2rem;
    text-align: center;
}

.navigation.pagination .nav-links {
    display: inline-flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.navigation.pagination .page-numbers {
    display: inline-block;
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--color-border);
    color: var(--color-dark);
    border-radius: 3px;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.navigation.pagination .page-numbers.current,
.navigation.pagination .page-numbers:hover {
    background-color: var(--color-indigo);
    border-color: var(--color-indigo);
    color: #fff;
    text-decoration: none;
}

/* ═══════════════════════════════════════════════
   RESPONSIVE — breakpoints: 768px tablet, 480px mobile, 375px small
═══════════════════════════════════════════════ */

/* ── Tablet (≤ 768px) ── */
@media (max-width: 768px) {
    .site-header .container {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .main-navigation ul {
        gap: 1rem;
    }

    .hero-section {
        padding: 4rem 1.25rem;
        min-height: calc(100vh - 60px);
    }

    .hero-inner {
        max-width: 100%;
    }

    .hero-headline {
        font-size: clamp(1.75rem, 6vw, 2.75rem);
    }

    .hero-subheading {
        font-size: 1rem;
        max-width: 100%;
        margin-bottom: 2rem;
    }

    /* Expanded card adapts width */
    .login-morph.expanded {
        width: min(380px, calc(100vw - 3rem));
        max-height: 660px;
    }

    .morph-field input {
        padding: 0.6rem 0;
        min-height: 48px;
    }
}

/* ── Mobile (≤ 480px) ── */
@media (max-width: 480px) {
    .site-header .container {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
    }

    .site-branding .site-title {
        font-size: 1.2rem;
    }

    .site-branding .site-description {
        font-size: 0.75rem;
    }

    .main-navigation ul {
        gap: 0.75rem;
    }

    .main-navigation a {
        font-size: 0.85rem;
    }

    .hero-section {
        padding: 3rem 1rem 3.5rem;
    }

    .hero-brand {
        font-size: 0.78rem;
        letter-spacing: 0.15em;
        margin-bottom: 1.25rem;
    }

    .hero-headline {
        font-size: clamp(1.6rem, 8vw, 2.25rem);
        margin-bottom: 1rem;
    }

    .hero-subheading {
        font-size: 0.95rem;
        line-height: 1.65;
        margin-bottom: 1.75rem;
    }

    /* Button collapsed size stays readable */
    .login-morph {
        width: 136px;
        max-height: 48px;
    }

    /* Expanded card: near full width on mobile */
    .login-morph.expanded {
        width: calc(100vw - 2rem);
        max-height: 680px;
        border-radius: 16px;
        padding: 1.75rem 1.5rem 1.5rem;
    }

    .morph-close {
        top: 0.75rem;
        right: 0.75rem;
        padding: 0.5rem 0.6rem;  /* bigger tap target */
        font-size: 1.1rem;
    }

    .morph-field input {
        padding: 0.65rem 0;
        min-height: 48px;         /* WCAG tap target */
        font-size: 1rem;          /* prevent iOS zoom */
    }

    .morph-field label {
        font-size: 0.65rem;
    }

    .morph-tab {
        font-size: 0.75rem;
        padding: 0.6rem 0;
    }

    .morph-submit {
        padding: 0.9rem;
        min-height: 48px;
        font-size: 0.95rem;
    }

    .morph-forgot {
        margin-top: 1rem;
        font-size: 0.85rem;
        padding: 0.5rem 0;        /* tap target */
    }

    /* Welcome page */
    .welcome-section .hero-headline {
        font-size: clamp(1.4rem, 7vw, 2rem);
    }

    .btn-logout {
        padding: 0.85rem 2rem;
        min-height: 48px;
        font-size: 0.9rem;
    }
}

/* ── Small mobile (≤ 375px) ── */
@media (max-width: 375px) {
    .hero-headline {
        font-size: clamp(1.4rem, 9vw, 1.9rem);
    }

    .hero-subheading {
        font-size: 0.9rem;
    }

    .login-morph.expanded {
        width: calc(100vw - 1.5rem);
        padding: 1.5rem 1.25rem 1.25rem;
    }

    .morph-field input {
        font-size: 16px;          /* hard-pin to prevent iOS zoom */
    }
}

/* ── No horizontal scroll guard ── */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

/* ── Forgot / Reset hint text ── */
.morph-hint {
    font-size: .82rem;
    color: #6b7280;
    text-align: center;
    margin: 0 0 1.35rem;
    line-height: 1.55;
}

/* ── Back-to-login text button ── */
.morph-back {
    display: block;
    width: 100%;
    background: none;
    border: none;
    margin-top: .85rem;
    padding: .45rem 0;
    font-size: .82rem;
    color: #c4c4cf;
    cursor: pointer;
    text-align: center;
    transition: color .18s;
}
.morph-back:hover { color: #6b7280; }

/* ── Welcome page overrides ── */
.welcome-section .hero-headline {
    font-size: clamp(1.9rem, 4.5vw, 3rem);
}

/* Green typed cursor for welcome page */
.welcome-cursor {
    background: #22C55E !important;
}

/* Welcome inner — slightly more vertical breathing room */
.welcome-inner {
    max-width: 640px;
}

@media (max-width: 480px) {
    .welcome-section .hero-headline {
        font-size: clamp(1.5rem, 7.5vw, 2rem);
    }
}

/* ── Welcome / onboarding — hi4 stagger (form block fades in last) ── */
.hi4 {
    opacity: 0;
    animation: fadeSlideUp 0.65s ease 0.7s forwards;
}
