/* Base Style for older adults */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Pretendard', sans-serif;
}

body {
    background-color: #f5f6fa;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    color: #111;
}

.mobile-container {
    width: 100%;
    max-width: 480px;
    background-color: #fff;
    min-height: 100vh;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
    position: relative;
    padding-bottom: 40px;
}

/* Header */
.app-header {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 2px solid #eee;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 100;
}

.back-link {
    color: #555;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.back-icon {
    margin-right: 5px;
    font-size: 20px;
    font-weight: bold;
}

.header-title {
    font-size: 18px;
    font-weight: 800;
    color: #333;
    text-align: right;
    word-break: keep-all;
    margin-left: 10px;
}

/* Content */
.content {
    padding: 30px 20px;
}

/* Intro */
.intro-section {
    text-align: left;
    margin-bottom: 35px;
    background: #f0f4ff;
    padding: 25px 20px;
    border-radius: 15px;
}

.intro-section h2 {
    font-size: 24px;
    font-weight: 800;
    color: #3b3b98;
    margin-bottom: 12px;
    word-break: keep-all;
    line-height: 1.4;
}

.intro-section p {
    font-size: 18px;
    color: #444;
    line-height: 1.6;
    word-break: keep-all;
    font-weight: 500;
}

/* Form Elements */
.dream-form {
    display: flex;
    flex-direction: column;
    gap: 35px;
}

.form-group {
    background: #fafafa;
    border-radius: 16px;
    padding: 25px 20px;
    border: 1px solid #e0e0e0;
}

.form-label {
    font-size: 21px;
    font-weight: 800;
    color: #222;
    margin-bottom: 12px;
    display: block;
    line-height: 1.3;
}

.form-help {
    font-size: 16px;
    color: #666;
    margin-bottom: 18px;
    line-height: 1.4;
}

/* Form inputs optimized for touch and readability */
.form-input {
    width: 100%;
    padding: 18px;
    font-size: 20px;
    border: 2px solid #ccc;
    border-radius: 12px;
    resize: none;
    background: #fff;
    color: #000;
    transition: border-color 0.2s;
    line-height: 1.5;
}

.form-input:focus {
    border-color: #3b3b98;
    outline: none;
}

.form-input::placeholder {
    color: #999;
    font-size: 18px;
}

/* Emoji Buttons */
.emoji-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.emoji-btn {
    padding: 18px 5px;
    font-size: 18px;
    font-weight: 600;
    border: 2px solid #ddd;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    color: #444;
    transition: all 0.2s;
}

.emoji-btn.active {
    border-color: #3b3b98;
    background: #eff3ff;
    color: #3b3b98;
    font-weight: 800;
}

/* Select boxes */
.form-select {
    width: 100%;
    padding: 18px;
    font-size: 19px;
    font-weight: 600;
    border: 2px solid #ccc;
    border-radius: 12px;
    background: #fff;
    color: #111;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23333%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 18px auto;
}

/* Radio Buttons */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-label {
    display: block;
    position: relative;
    cursor: pointer;
}

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

.radio-custom {
    display: block;
    padding: 18px 20px;
    font-size: 19px;
    font-weight: 600;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 12px;
    color: #444;
    transition: all 0.2s;
}

.radio-label input:checked~.radio-custom {
    border-color: #3b3b98;
    background: #eff3ff;
    color: #3b3b98;
    font-weight: 800;
}

/* Submit Button */
.submit-section {
    margin-top: 10px;
    text-align: center;
}

.submit-btn {
    width: 100%;
    padding: 22px;
    font-size: 24px;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, #4b4b8f, #2c2c6d);
    border: none;
    border-radius: 16px;
    cursor: pointer;
    box-shadow: 0 8px 15px rgba(75, 75, 143, 0.3);
    transition: transform 0.2s;
    letter-spacing: 0.5px;
}

.submit-btn:active {
    transform: translateY(3px);
}

.remaining-count {
    margin-top: 20px;
    font-size: 18px;
    color: #666;
    font-weight: 500;
}

.remaining-count span {
    font-weight: 800;
    color: #e74c3c;
    font-size: 22px;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: #fff;
    padding: 35px 25px;
    border-radius: 20px;
    width: 90%;
    max-width: 420px;
    text-align: center;
}

.modal-content h3 {
    font-size: 24px;
    font-weight: 800;
    color: #222;
    margin-bottom: 18px;
}

.modal-content p {
    font-size: 19px;
    color: #444;
    margin-bottom: 25px;
    line-height: 1.6;
    word-break: keep-all;
}

.modal-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal-btn {
    padding: 18px;
    font-size: 20px;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    border: none;
}

.modal-btn.primary {
    background: #3b3b98;
    color: #fff;
}

.modal-btn.secondary {
    background: #ddd;
    color: #333;
}

/* Loading State */
.loading-state {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px 20px;
    text-align: center;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 6px solid #f3f3f3;
    border-top: 6px solid #3b3b98;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 25px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-state h3 {
    font-size: 22px;
    font-weight: 800;
    color: #3b3b98;
    margin-bottom: 10px;
}

.loading-state p {
    font-size: 17px;
    color: #666;
}

/* Result Page */
.result-body {
    background-color: #f0f4ff;
}

.result-container {
    background: transparent;
    box-shadow: none;
}

.result-header {
    background: transparent;
    border-bottom: none;
}

.user-input-summary {
    background: #fff;
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    border-left: 5px solid #3b3b98;
}

.summary-label {
    font-size: 15px;
    color: #888;
    margin-bottom: 8px;
    font-weight: 600;
}

.summary-text {
    font-size: 18px;
    color: #333;
    line-height: 1.5;
    font-style: italic;
    margin-bottom: 12px;
}

.summary-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.chip {
    padding: 6px 12px;
    background: #e0e7ff;
    color: #3b3b98;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
}

.ai-interpretation {
    background: #fff;
    padding: 30px 22px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    line-height: 1.8;
}

.ai-interpretation p {
    font-size: 19px;
    color: #222;
    margin-bottom: 20px;
    word-break: keep-all;
}

.ai-interpretation strong {
    color: #3b3b98;
    font-weight: 800;
}

.ai-interpretation h1,
.ai-interpretation h2,
.ai-interpretation h3 {
    font-size: 22px;
    color: #111;
    margin-top: 30px;
    margin-bottom: 15px;
    font-weight: 800;
}

.result-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 40px;
}

.action-btn {
    padding: 18px;
    font-size: 19px;
    font-weight: 700;
    border-radius: 14px;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    border: none;
}

.kakao-btn {
    background: #fee500;
    color: #3c1e1e;
}

.secondary-btn {
    background: #fff;
    color: #555;
    border: 2px solid #ddd;
}

.home-btn {
    background: #333;
    color: #fff;
}