/* ============================================================================
   RemindMe - CSS Design System
   Soft Tactile Theme: Friendly, Accessible, Trustworthy
   ============================================================================ */

/* CSS Custom Properties */
.theme-soft {
    /* Colors - Warm cream base with sage green accents */
    --color-bg: #faf8f5;
    --color-bg-elevated: #ffffff;
    --color-bg-card: #ffffff;
    --color-surface: #f5f2ed;
    
    --color-text: #2e3440;
    --color-text-muted: #5a6274;
    --color-text-subtle: #8b91a0;
    
    /* Sage green accent - trustworthy and calming */
    --color-accent: #5b8a72;
    --color-accent-hover: #4a7660;
    --color-accent-glow: rgba(91, 138, 114, 0.2);
    
    --color-success: #5b8a72;
    --color-error: #c4564a;
    --color-warning: #d4915c;
    
    --color-border: #e8e4dd;
    --color-border-strong: #d6d0c6;
    
    /* Typography - Nunito: friendly, rounded sans-serif */
    --font-display: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
    
    /* Border radius - extra rounded, pill-like */
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-pill: 100px;
    
    /* Shadows - soft and pressable */
    --shadow-soft: 0 2px 8px rgba(46, 52, 64, 0.06);
    --shadow-elevated: 0 8px 24px rgba(46, 52, 64, 0.08);
    --shadow-pressed: inset 0 2px 4px rgba(46, 52, 64, 0.1);
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 5rem;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    background: var(--color-bg);
    background-image: linear-gradient(180deg, var(--color-bg) 0%, #f0ebe4 100%);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

/* Header */
.header {
    padding: var(--space-lg) var(--space-xl);
    position: relative;
    z-index: 10;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    text-decoration: none;
    color: var(--color-text);
}

.logo-icon {
    font-size: 1.5rem;
}

.logo-text {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

/* Main content */
.main {
    flex: 1;
    padding: 0 var(--space-xl);
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    position: relative;
    z-index: 10;
}

/* Hero Section */
.hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3xl);
    align-items: center;
    min-height: calc(100vh - 200px);
    padding: var(--space-xl) 0;
}

@media (max-width: 900px) {
    .hero {
        grid-template-columns: 1fr;
        gap: var(--space-2xl);
        text-align: center;
    }
}

.hero-content {
    animation: fadeInUp 0.8s var(--transition-slow) both;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-lg);
}

.title-accent {
    color: var(--color-accent);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--color-text-muted);
    max-width: 400px;
    margin-bottom: var(--space-xl);
}

@media (max-width: 900px) {
    .hero-subtitle {
        margin-left: auto;
        margin-right: auto;
    }
}

.feature-pills {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

@media (max-width: 900px) {
    .feature-pills {
        justify-content: center;
    }
}

.pill {
    background: var(--color-surface);
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-pill);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
}

/* Registration Card */
.register-card {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    border: 1px solid var(--color-border);
    box-shadow: 
        0 1px 2px rgba(46, 52, 64, 0.04),
        0 4px 16px rgba(46, 52, 64, 0.06),
        0 12px 32px rgba(46, 52, 64, 0.04);
    animation: fadeInUp 0.8s var(--transition-slow) 0.2s both;
}

.card-header {
    margin-bottom: var(--space-xl);
}

.card-header h2 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: var(--space-xs);
}

.card-header p {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

/* Error banner */
.error-banner {
    background: rgba(196, 86, 74, 0.08);
    border: 2px solid rgba(196, 86, 74, 0.3);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.9rem;
    color: var(--color-error);
}

/* Form styles */
.register-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.form-group label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-text);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: var(--space-md);
    font-size: 1.1rem;
    pointer-events: none;
}

.input-wrapper input,
.input-wrapper select {
    width: 100%;
    padding: 1rem 1rem 1rem 3.25rem;
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-size: 1.0625rem;
    font-family: inherit;
    transition: var(--transition-fast);
}

.input-wrapper input:focus,
.input-wrapper select:focus {
    outline: none;
    border-color: var(--color-accent);
    background: var(--color-bg-card);
    box-shadow: 0 0 0 4px var(--color-accent-glow);
}

.input-wrapper input::placeholder {
    color: var(--color-text-subtle);
}

.input-wrapper select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%235a6274' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 3rem;
}

.input-hint {
    font-size: 0.8rem;
    color: var(--color-text-subtle);
}

/* Split phone input layout */
.phone-input-row {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: var(--space-sm);
}

.country-code-wrapper {
    flex: 0 0 70px;
    width: 70px;
    min-width: 70px;
    max-width: 70px;
}

.input-wrapper.country-code-wrapper .country-code-input {
    width: 100%;
    padding: 1rem 0.25rem;
    text-align: center;
    font-weight: 600;
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text-muted);
    font-size: 1.0625rem;
    font-family: inherit;
    transition: var(--transition-fast);
    box-sizing: border-box;
    cursor: default;
    /* Readonly field - US only for now */
    user-select: none;
    -webkit-user-select: none;
}

.phone-wrapper {
    flex: 1;
    min-width: 0;
}

/* Checkbox styles */
.checkbox-group {
    margin-top: var(--space-sm);
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    cursor: pointer;
    line-height: 1.4;
}

.checkbox-label input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkmark {
    width: 26px;
    height: 26px;
    min-width: 26px;
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.checkbox-label input:checked + .checkmark {
    background: var(--color-accent);
    border-color: var(--color-accent);
}

.checkbox-label input:checked + .checkmark::after {
    content: '✓';
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
}

.checkbox-label input:focus + .checkmark {
    box-shadow: 0 0 0 4px var(--color-accent-glow);
}

.checkbox-text {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

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

.checkbox-text a:hover {
    text-decoration: underline;
}

/* Submit button - pill-shaped and pressable */
.submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    width: 100%;
    padding: 1.125rem 2rem;
    background: var(--color-accent);
    color: white;
    border: none;
    border-radius: var(--radius-pill);
    font-size: 1.0625rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: var(--space-sm);
    box-shadow: 
        0 4px 12px var(--color-accent-glow),
        0 2px 4px rgba(46, 52, 64, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.submit-btn:hover {
    background: var(--color-accent-hover);
    transform: translateY(-2px);
    box-shadow: 
        0 8px 20px var(--color-accent-glow),
        0 4px 8px rgba(46, 52, 64, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.submit-btn:active {
    transform: translateY(1px);
    box-shadow: 
        0 2px 6px var(--color-accent-glow),
        inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-arrow {
    transition: var(--transition-fast);
}

.submit-btn:hover .btn-arrow {
    transform: translateX(4px);
}

/* How it works section */
.how-it-works {
    padding: var(--space-3xl) 0;
    text-align: center;
    animation: fadeInUp 0.8s var(--transition-slow) 0.4s both;
}

.how-it-works h2 {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: var(--space-2xl);
}

.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-xl);
    margin-bottom: var(--space-3xl);
}

@media (max-width: 700px) {
    .steps {
        grid-template-columns: 1fr;
        max-width: 300px;
        margin-left: auto;
        margin-right: auto;
    }
}

.step {
    padding: var(--space-xl);
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-soft);
}

.step-number {
    width: 56px;
    height: 56px;
    background: var(--color-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.5rem;
    margin: 0 auto var(--space-md);
    color: white;
    box-shadow: 0 4px 12px var(--color-accent-glow);
}

.step h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
}

.step p {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

/* Example messages */
.example-messages {
    max-width: 500px;
    margin: 0 auto;
}

.example-messages h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: var(--space-xl);
}

.message-bubbles {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    text-align: left;
}

.bubble {
    padding: var(--space-md) var(--space-lg);
    font-size: 0.9rem;
    line-height: 1.5;
    max-width: 85%;
    animation: bubbleIn 0.4s var(--transition-slow) both;
}

.bubble:nth-child(1) { animation-delay: 0.1s; }
.bubble:nth-child(2) { animation-delay: 0.2s; }
.bubble:nth-child(3) { animation-delay: 0.3s; }
.bubble:nth-child(4) { animation-delay: 0.4s; }
.bubble:nth-child(5) { animation-delay: 0.5s; }
.bubble:nth-child(6) { animation-delay: 0.6s; }

.bubble.outgoing {
    background: var(--color-accent);
    color: white;
    align-self: flex-end;
    border-radius: 20px 20px 6px 20px;
    box-shadow: 0 2px 8px var(--color-accent-glow);
}

.bubble.incoming {
    background: var(--color-surface);
    color: var(--color-text);
    align-self: flex-start;
    border: 1px solid var(--color-border);
    border-radius: 20px 20px 20px 6px;
}

@keyframes bubbleIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Success page */
.success-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 200px);
    padding: var(--space-xl) 0;
}

.success-card {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    max-width: 500px;
    width: 100%;
    text-align: center;
    border: 1px solid var(--color-border);
    box-shadow: 
        0 1px 2px rgba(46, 52, 64, 0.04),
        0 4px 16px rgba(46, 52, 64, 0.06),
        0 12px 32px rgba(46, 52, 64, 0.04);
    animation: fadeInUp 0.6s var(--transition-slow) both;
}

/* Animated checkmark */
.success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-xl);
}

.checkmark-svg {
    width: 100%;
    height: 100%;
}

.checkmark-circle {
    stroke: var(--color-success);
    stroke-width: 2;
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    animation: strokeCircle 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark-check {
    stroke: var(--color-success);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: strokeCheck 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.4s forwards;
}

@keyframes strokeCircle {
    100% { stroke-dashoffset: 0; }
}

@keyframes strokeCheck {
    100% { stroke-dashoffset: 0; }
}

.success-title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: var(--space-xl);
}

.success-details {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.detail-label {
    font-size: 0.8rem;
    color: var(--color-text-subtle);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.detail-value {
    font-size: 1.1rem;
    font-weight: 600;
}

.twilio-number {
    color: var(--color-accent);
    font-family: 'SF Mono', 'Menlo', monospace;
}

.detail-divider {
    height: 1px;
    background: var(--color-border);
    margin: var(--space-md) 0;
}

/* Quick start */
.quick-start {
    margin-bottom: var(--space-xl);
}

.quick-start h2 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
}

.quick-start p {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin-bottom: var(--space-md);
}

.sample-text {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    background: var(--color-surface);
    padding: var(--space-md);
    border-radius: var(--radius-md);
}

.sample-text code {
    flex: 1;
    text-align: left;
    font-size: 0.85rem;
    color: var(--color-text);
    word-break: break-word;
}

.copy-btn {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-pill);
    color: var(--color-text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    white-space: nowrap;
}

.copy-btn:hover {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: white;
}

.copy-btn.copied {
    background: var(--color-success);
    border-color: var(--color-success);
    color: white;
}

/* Format reference */
.format-reference {
    text-align: left;
    background: var(--color-surface);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.format-reference h3 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: var(--space-md);
}

.format-reference ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.format-reference li {
    font-size: 0.85rem;
}

.format-reference strong {
    display: block;
    color: var(--color-text-muted);
    margin-bottom: var(--space-xs);
}

.format-reference code {
    display: block;
    background: var(--color-bg-card);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    overflow-x: auto;
}

.back-link {
    color: var(--color-accent);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: var(--transition-fast);
}

.back-link:hover {
    color: var(--color-accent-hover);
}

/* Footer */
.footer {
    padding: var(--space-xl);
    text-align: center;
    color: var(--color-text-subtle);
    font-size: 0.85rem;
    position: relative;
    z-index: 10;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Screenshot gallery */
.screenshot-gallery {
    max-width: 900px;
    margin: 0 auto;
}

.screenshot-gallery h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: var(--space-xl);
}

.screenshots {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
    align-items: center;
}

@media (max-width: 700px) {
    .screenshots {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin: 0 auto;
    }
}

.screenshots-left {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.screenshots-right {
    display: flex;
    justify-content: center;
}

.screenshots img {
    width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-elevated);
    transition: transform var(--transition-base);
}

.screenshots-right img {
    max-width: 280px;
}

.screenshots img:hover {
    transform: scale(1.03);
}

/* Site footer */
.site-footer {
    padding: var(--space-xl) var(--space-md);
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--color-border);
    margin-top: var(--space-2xl);
}

.site-footer a {
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 600;
}

.site-footer a:hover {
    text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .main {
        padding: 0 var(--space-md);
    }

    .register-card {
        padding: var(--space-xl);
    }

    .success-card {
        padding: var(--space-xl);
    }

    .sample-text {
        flex-direction: column;
    }

    .sample-text code {
        text-align: center;
    }
}
