/* ── Root Variables ── */
:root {
    --roci-dark:      #0e0e0e;
    --roci-dark-mid:  #1a1a1a;
    --roci-bg:        #f8f8f6;
    --roci-white:     #ffffff;
    --roci-text:      #0c0c0c;
    --roci-text-mid:  #484848;
    --roci-text-soft: #6b6b6b;  /* WCAG AA ✓ */
    --roci-border:    rgba(0,0,0,0.15);
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--roci-bg);
    color: var(--roci-text);
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
}

.mi {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 20px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-smoothing: antialiased;
    font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
}

/* ── Auth Overlay ── */
.auth-overlay {
    position: fixed;
    inset: 0;
    background: var(--roci-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.auth-card {
    background: var(--roci-dark-mid);
    padding: 48px;
    width: 100%;
    max-width: 440px;
    border: 1px solid rgba(255,255,255,0.1);
}

.auth-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    font-weight: 400;
    color: var(--roci-white);
    margin-bottom: 8px;
}

.auth-sub {
    font-size: 0.88rem;
    color: rgba(255,255,255,0.7);
    margin-bottom: 32px;
}

.auth-card label {
    color: rgba(255,255,255,0.75);
}

.auth-card input {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    width: 100%;
    padding: 12px 14px;
    margin-bottom: 16px;
    font-family: 'Inter', sans-serif;
    outline: none;
}

.auth-card input:focus {
    border-color: rgba(255,255,255,0.5);
}

.auth-actions {
    margin-top: 24px;
}

.auth-actions .btn {
    width: 100%;
    text-align: center;
}

.auth-toggle {
    margin-top: 16px;
    text-align: center;
}

.auth-toggle a {
    color: rgba(255,255,255,0.5);
    font-size: 0.8rem;
    text-decoration: none;
}

.auth-toggle a:hover {
    color: #fff;
}

/* ── Header ── */
.roci-header {
    background: var(--roci-dark);
    padding: 40px 40px 0;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
}

.header-eyebrow {
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem;
    font-weight: 400;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.65);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-eyebrow::before {
    content: '';
    display: block;
    width: 20px;
    height: 1px;
    background: rgba(255,255,255,0.5);
}

.roci-header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.4rem;
    font-weight: 400;
    line-height: 1.15;
    color: #ffffff;
    margin: 0 0 24px 0;
}

/* ── Main Nav ── */
.main-nav {
    display: flex;
    gap: 0;
}

.nav-btn {
    background: transparent;
    border: none;
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.5);
    padding: 16px 24px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s;
}

.nav-btn .mi {
    font-size: 16px;
}

.nav-btn:hover {
    color: rgba(255,255,255,0.8);
}

.nav-btn.active {
    color: #fff;
    border-bottom-color: #fff;
}

#logout-btn {
    margin-left: auto;
}

/* ── Layout ── */
.app-layout {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 40px;
}

.app-view {
    display: none;
}

.app-view.active {
    display: block;
}

.view-header {
    margin-bottom: 32px;
}

.view-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 400;
    color: var(--roci-dark);
    margin-bottom: 8px;
}

.view-header p {
    color: var(--roci-text-mid);
    font-size: 0.95rem;
}

/* ── Dashboard List View ── */
.expose-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.expose-search-wrapper .mi {
    position: absolute;
    left: 12px;
    font-size: 1rem;
    color: var(--roci-text-soft);
    pointer-events: none;
}
.expose-search-wrapper input {
    width: 260px;
    padding: 9px 14px 9px 36px !important;
    font-size: 0.83rem !important;
    border: 1px solid var(--roci-border);
    background: var(--roci-white);
    outline: none;
    transition: border-color 0.2s;
}
.expose-search-wrapper input:focus { border-color: var(--roci-text); }

.exposes-list {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--roci-border);
    background: var(--roci-white);
    overflow: hidden;
}

.expose-list-header {
    display: grid;
    grid-template-columns: 1fr 160px 60px 196px;
    padding: 10px 20px;
    background: var(--roci-bg);
    border-bottom: 1px solid var(--roci-border);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--roci-text-soft);
    font-weight: 500;
}

.expose-row {
    display: grid;
    grid-template-columns: 1fr 160px 60px 196px;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--roci-border);
    transition: background 0.12s;
    gap: 8px;
}
.expose-row:last-child { border-bottom: none; }
.expose-row:hover { background: #faf9f7; }

.expose-row-title {
    font-family: 'Playfair Display', serif;
    font-size: 0.93rem;
    font-weight: 400;
    color: var(--roci-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.expose-row-address {
    font-size: 0.7rem;
    color: var(--roci-text-soft);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.expose-row-date { font-size: 0.73rem; color: var(--roci-text-mid); }
.expose-row-views { font-size: 0.73rem; color: var(--roci-text-soft); text-align: center; }

.expose-row-actions {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
}
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--roci-border);
    background: transparent;
    color: var(--roci-text-mid);
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    text-decoration: none;
    font-size: 1.05rem;
    flex-shrink: 0;
}
.icon-btn:hover { background: var(--roci-text); color: #fff; border-color: var(--roci-text); }
.icon-btn.danger:hover { background: #c62828; border-color: #c62828; color: #fff; }
.expose-list-empty {
    padding: 48px 20px;
    text-align: center;
    color: var(--roci-text-soft);
    font-size: 0.85rem;
}

/* ── Profiles Settings ── */
.profiles-container {
    display: flex;
    gap: 48px;
    align-items: flex-start;
}

.profiles-list-wrapper {
    flex: 1;
}

.profile-form-wrapper {
    flex: 1;
    background: var(--roci-white);
    padding: 32px;
    border: 1px solid var(--roci-border);
}

.profile-card {
    background: var(--roci-white);
    border: 1px solid var(--roci-border);
    padding: 16px 20px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.profile-card-info h4 {
    font-weight: 500;
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.profile-card-info p {
    font-size: 0.8rem;
    color: var(--roci-text-soft);
}

.profile-card .del-btn {
    background: transparent;
    border: none;
    color: #d32f2f;
    cursor: pointer;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ── Generator Form ── */
.app-form {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.sidebar {
    flex: 0 0 320px;
    background: var(--roci-dark);
    padding: 30px;
    border: 1px solid rgba(255,255,255,0.1);
}

.sidebar h3 {
    font-family: 'Playfair Display', serif;
    font-weight: 400;
    font-size: 1.15rem;
    color: rgba(255,255,255,0.85);
    letter-spacing: 0.02em;
    margin-bottom: 16px;
}

.sidebar hr {
    border: 0;
    border-top: 1px solid rgba(255,255,255,0.15);
    margin: 16px 0;
}

.sidebar .sidebar-label {
    font-size: 0.65rem;
    font-weight: 400;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.65);
    margin: 24px 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar label {
    display: block;
    color: rgba(255,255,255,0.75);
    font-size: 0.65rem;
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.sidebar input[type="text"],
.sidebar input[type="email"],
.sidebar input[type="file"],
.sidebar select {
    width: 100%;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.2);
    color: #ffffff;
    font-weight: 400;
    font-size: 0.88rem;
    padding: 10px 12px;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color 0.2s;
}

.sidebar select option {
    background: var(--roci-dark);
    color: #fff;
}

.sidebar input:focus, .sidebar select:focus {
    border-color: rgba(255,255,255,0.5);
}

.sidebar input::placeholder {
    color: rgba(255,255,255,0.5);
    font-weight: 300;
}

.sidebar .form-group {
    margin-bottom: 16px;
}

.main-content {
    flex: 1;
    min-width: 0;
}

/* ── Tabs ── */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--roci-border);
    margin-bottom: 32px;
}

.tab-btn {
    background: transparent;
    border: none;
    font-family: 'Inter', sans-serif;
    font-size: 0.68rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--roci-text-mid);
    padding: 14px 24px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.tab-btn:hover {
    color: var(--roci-text);
}

.tab-btn.active {
    color: var(--roci-text);
    border-bottom-color: var(--roci-dark);
    font-weight: 500;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* ── Form Elements ── */
.section-title {
    font-size: 0.58rem;
    font-weight: 400;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--roci-text-mid);
    padding-bottom: 12px;
    border-bottom: 1px solid var(--roci-border);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-group {
    margin-bottom: 20px;
    width: 100%;
}

label {
    display: block;
    font-size: 0.62rem;
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--roci-text-mid);
    margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="password"],
select,
textarea,
input[type="file"] {
    width: 100%;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 0.88rem;
    color: var(--roci-text);
    border: 1px solid var(--roci-border);
    background: var(--roci-white);
    padding: 12px 14px;
    outline: none;
    transition: border-color 0.2s;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--roci-text);
}

input::placeholder, textarea::placeholder {
    color: #767676; /* WCAG AA ✓ */
    font-weight: 300;
}

textarea {
    resize: vertical;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-row .form-group {
    margin-bottom: 0;
    flex: 1;
}

.three-cols .form-group {
    flex: 1;
}

.upload-label {
    font-size: 0.72rem;
    font-weight: 400;
    color: var(--roci-text);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.upload-hint {
    font-size: 0.72rem;
    font-weight: 300;
    color: var(--roci-text-mid);
    margin-bottom: 8px;
}

/* ── Buttons ── */
.btn {
    font-family: 'Inter', sans-serif;
    font-size: 0.68rem;
    font-weight: 400;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 14px 32px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.btn-primary {
    background: var(--roci-dark);
    color: var(--roci-white);
    border: none;
}

.btn-primary:hover {
    background: var(--roci-dark-mid);
}

.btn-ghost {
    background: transparent;
    color: var(--roci-text);
    border: 1px solid var(--roci-border);
}

.btn-ghost:hover {
    background: var(--roci-dark);
    color: var(--roci-white);
    border-color: var(--roci-dark);
}

.status-message {
    text-align: center;
    margin-top: 16px;
    font-size: 0.88rem;
}

/* ── Custom Modal ── */
.roci-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.roci-modal.active {
    display: flex;
}

.roci-modal-card {
    background: var(--roci-white);
    padding: 32px;
    width: 100%;
    max-width: 400px;
    border: 1px solid var(--roci-border);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.roci-modal-card h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 12px;
}

.roci-modal-card p {
    font-size: 0.9rem;
    color: var(--roci-text-mid);
    margin-bottom: 32px;
}

.roci-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.roci-modal-actions .btn {
    padding: 10px 20px;
    font-size: 0.65rem;
}

/* ── Live Preview ── */
.live-preview {
    background: #0e0e0e;
    color: #fff;
    font-family: 'Inter', sans-serif;
    border: 1px solid rgba(255,255,255,0.1);
    max-width: 100%;
    overflow: hidden;
}

.lp-cover {
    position: relative;
    height: 280px;
    background-size: cover;
    background-position: center;
    background-color: #1a1a1a;
    display: flex;
    align-items: flex-end;
}

.lp-cover-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(14,14,14,0.95), transparent 60%);
}

.lp-cover-content {
    position: relative;
    z-index: 1;
    padding: 24px;
    width: 100%;
}

.lp-eyebrow {
    font-size: 0.55rem;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: rgba(255,255,255,0.4);
    margin-bottom: 8px;
}

.lp-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    font-weight: 400;
    line-height: 1.15;
    margin-bottom: 6px;
}

.lp-address {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.5);
    margin-bottom: 12px;
}

.lp-price-badge {
    display: inline-block;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 4px 12px;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.lp-section {
    padding: 20px 24px;
}

.lp-section-label {
    font-size: 0.55rem;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: rgba(255,255,255,0.35);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lp-section-label::before {
    content: '';
    display: block;
    width: 16px;
    height: 1px;
    background: rgba(255,255,255,0.3);
}

.lp-heading {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    font-weight: 400;
    margin-bottom: 12px;
}

.lp-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: rgba(255,255,255,0.08);
    margin-bottom: 16px;
}

.lp-stat {
    background: #0e0e0e;
    padding: 10px 6px;
    text-align: center;
}

.lp-stat-number {
    font-family: 'Playfair Display', serif;
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.lp-stat-label {
    font-size: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: rgba(255,255,255,0.35);
}

.lp-facts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border-top: 1px solid rgba(255,255,255,0.08);
    border-left: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 12px;
}

.lp-fact {
    border-right: 1px solid rgba(255,255,255,0.08);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding: 8px 10px;
}

.lp-fact-label {
    font-size: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: rgba(255,255,255,0.35);
    margin-bottom: 2px;
}

.lp-fact-value {
    font-family: 'Playfair Display', serif;
    font-size: 0.85rem;
}

.lp-features {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 12px;
}

.lp-feature-tag {
    border: 1px solid rgba(255,255,255,0.1);
    padding: 3px 8px;
    font-size: 0.6rem;
    color: rgba(255,255,255,0.5);
}

.lp-text {
    font-size: 0.8rem;
    font-weight: 300;
    line-height: 1.7;
    color: rgba(255,255,255,0.55);
}

.lp-dark-section {
    padding: 20px 24px;
    background: #1a1a1a;
}

.lp-contact {
    padding: 20px 24px;
    display: flex;
    gap: 16px;
    align-items: center;
}

.lp-contact-photo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.lp-contact-name {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    font-weight: 400;
    margin-bottom: 2px;
}

.lp-contact-job {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: rgba(255,255,255,0.4);
    margin-bottom: 6px;
}

.lp-contact-detail {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.55);
}

.lp-energy-bar {
    display: flex;
    gap: 1px;
    margin-top: 10px;
}

.lp-energy-seg {
    flex: 1;
    text-align: center;
    font-size: 0.5rem;
    font-weight: 500;
    padding: 3px 0;
    color: #fff;
}

.lp-placeholder {
    color: rgba(255,255,255,0.2);
    font-style: italic;
    font-size: 0.8rem;
    text-align: center;
    padding: 40px 20px;
}

/* ========================
   EMAIL SEND ANIMATION
   ======================== */

@keyframes planeTakeoff {
    0%   { transform: translate(0, 0) rotate(0deg); opacity: 1; }
    60%  { transform: translate(60px, -40px) rotate(-20deg); opacity: 1; }
    100% { transform: translate(120px, -80px) rotate(-30deg); opacity: 0; }
}

@keyframes planeReturn {
    0%   { transform: translate(-60px, 40px) rotate(-20deg); opacity: 0; }
    100% { transform: translate(0, 0) rotate(0deg); opacity: 1; }
}

@keyframes successPop {
    0%   { transform: scale(0.6); opacity: 0; }
    60%  { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes ripple {
    0%   { transform: scale(0); opacity: 0.6; }
    100% { transform: scale(3.5); opacity: 0; }
}

@keyframes trailFade {
    0%   { opacity: 0.7; width: 0px; }
    100% { opacity: 0; width: 50px; }
}

.send-btn-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
}

.send-btn-wrapper .ripple-ring {
    position: absolute;
    top: 50%; left: 50%;
    width: 10px; height: 10px;
    margin: -5px 0 0 -5px;
    border-radius: 50%;
    background: rgba(255,255,255,0.35);
    pointer-events: none;
    animation: ripple 0.6s ease-out forwards;
}

#email-modal-send .mi {
    display: inline-block;
    transition: transform 0.3s ease;
}

#email-modal-send.sending .mi {
    animation: planeTakeoff 0.5s ease-in forwards;
}

#email-modal-send.sent-success {
    background: #1e6e3a !important;
    border-color: #1e6e3a !important;
    pointer-events: none;
}

#email-modal-send.sent-success .mi {
    animation: planeReturn 0.4s ease-out forwards;
}

.email-success-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(30, 110, 58, 0.97);
    border-radius: inherit;
    animation: successPop 0.4s cubic-bezier(.34,1.56,.64,1) forwards;
    pointer-events: none;
    z-index: 10;
    font-size: 0.85rem;
    font-weight: 500;
    color: #fff;
    gap: 8px;
    letter-spacing: 0.02em;
}
