:root {
    --serif-font-size: 1rem;
    --line-height-offset: 0.25rem;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #6B8FA3 0%, #7A9BB3 100%);
    color: #2C3E50;
    min-height: 100vh;
    padding: 2rem 1rem;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.logo {
    aspect-ratio: 1;
    margin: 0;
    display: block;
    opacity: 0.9;
    width: 48px;
    height: 48px;
}

h1 {
    color: #4A6FA5;
    margin-bottom: 1rem;
    font-size: 1.8rem;
    font-weight: 600;
}

.header-title {
    margin: 0;
}

.user-email {
    margin-right: 1rem;
    color: #666;
    font-size: 0.9rem;
}

.login .header-title {
    text-align: center;
    margin-bottom: 2rem;
    color: #2c3e50;
    font-size: 1.5rem;
}

p {
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

p.same-paragraph {
    text-indent: 0;
}

p:not(.line) {
    text-indent: 2rem;
}

.daily-reading {
    margin-top: 2rem;
}

.daily-reading h2 {
    color: #4A6FA5;
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    font-weight: 500;
}

.line-group {
    margin-top: 1.25rem;
    margin-bottom: 1.25rem;
}

.line {
    margin: 0;
    font-size: var(--serif-font-size);
    line-height: calc(var(--serif-font-size) + var(--line-height-offset));
}

.line.indent {
    padding-left: 2rem;
}

.verse {
    color: #5A6C7D;
}

.verses {
    list-style: none;
    max-width: 600px;
    margin: 0 auto;
}

.verses p {
    margin-bottom: 0.9rem;
}

.verses li {
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    background: #F5F7FA;
    border-left: 3px solid #6B8FA3;
    border-radius: 4px;
    color: #2C3E50;
    line-height: 1.7;
}

.verses li:last-child {
    margin-bottom: 0;
}

.content-wrapper {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
    align-items: flex-start;
}

.verses-section {
    flex: 1;
    min-width: 0;
}

.soap-section {
    flex: 1;
    min-width: 0;
    position: sticky;
    top: 2rem;
    align-self: flex-start;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
}

.selected-verses-reference {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: #E8F4F8;
    border-left: 3px solid #4A6FA5;
    border-radius: 4px;
    color: #2C3E50;
    font-weight: 500;
    font-size: 0.95rem;
    display: none;
}

.soap-field {
    margin-bottom: 1.5rem;
}

.soap-field label {
    display: block;
    color: #4A6FA5;
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.soap-field textarea,
.soap-field input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #E0E6ED;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #2C3E50;
    background: #F5F7FA;
    resize: vertical;
    transition: border-color 0.2s;
}

.soap-field textarea:focus,
.soap-field input:focus {
    outline: none;
    border-color: #6B8FA3;
    background: #FFFFFF;
}

.save-status {
    font-size: 0.85rem;
    margin-top: 0.5rem;
    min-height: 1.2rem;
}

.save-status.saving {
    color: #6B8FA3;
}

.save-status.saved {
    color: #4CAF50;
}

.save-status.error {
    color: #F44336;
}

.verses-section .verse-content {
    cursor: pointer;
}

.verse-num {
    margin: 0 0.25rem;
}

.verse-selected {
    background-color: #FFF9C4 !important;
    border-radius: 3px;
    padding: 2px 4px;
    cursor: pointer;
}

.verse-num.verse-selected,
.verse-num.inline.verse-selected {
    background-color: #FFD54F !important;
    font-weight: bold;
    border-radius: 3px;
    padding: 1px 3px;
}

.verses-section .verse-selected {
    transition: background-color 0.2s;
}

.chapter-num {
    float: left;
    font-size: 4rem;
    line-height: 0.8;
    font-weight: 400;
    margin-right: 0.5rem;
    margin-top: 0.1rem;
    margin-bottom: -0.2rem;
    color: #2C3E50;
}

.header-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.logout-btn {
    text-decoration: none;
    color: #4A6FA5;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    border: 1px solid #4A6FA5;
    border-radius: 4px;
    transition: all 0.2s;
}

.logout-btn:hover {
    background-color: #4A6FA5;
    color: white;
}

/* Responsive: stack on narrow screens */
@media (max-width: 900px) {
    .content-wrapper {
        flex-direction: column;
    }

    .verses-section,
    .soap-section {
        width: 100%;
    }

    .soap-section {
        position: static;
        max-height: none;
        overflow-y: visible;
    }
}

.auth-container {
    max-width: 400px;
    margin: 4rem auto;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 500;
    color: #2c3e50;
}

.form-group input {
    padding: 0.75rem;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group input:focus {
    border-color: #4a6fa5;
    outline: none;
    box-shadow: 0 0 0 3px rgba(74, 111, 165, 0.1);
}

.auth-btn {
    background-color: #4a6fa5;
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.auth-btn:hover {
    background-color: #3b5a84;
}

.auth-switch {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #666;
}

.auth-switch a {
    color: #4a6fa5;
    text-decoration: none;
    font-weight: 500;
}

.auth-switch a:hover {
    text-decoration: underline;
}

.error-message {
    background-color: #fee2e2;
    color: #ef4444;
    padding: 0.75rem;
    border-radius: 4px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.logo-container {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}