/* DR カードシステム - スマートフォン向けスタイル */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
    min-width: 330px;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

/* ヘッダー（水色） */
.app-header {
    background-color: #b3e5fc;
    padding: 14px 16px;
    text-align: center;
    width: 100%;
}

.app-header > * {
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

.app-title {
    font-size: 18px;
    font-weight: bold;
    color: #1565c0;
    letter-spacing: 0.05em;
}

.app-logo {
    max-height: 38px;
    width: auto;
    display: block;
    margin: 0 auto;
}

.app-main {
    flex: 1;
    padding: 20px 16px 32px;
}

/* パンくずリスト */
.breadcrumb {
    font-size: 12px;
    color: #1565c0;
}

/* 画面共通 */
.screen {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding-top: 36px;
}

.screen:has(.screen-title) {
    padding-top: 24px;
}

.screen-title {
    font-size: 18px;
    font-weight: bold;
    color: #1a1a1a;
    text-align: center;
}

.screen-subtitle {
    font-size: 14px;
    color: #555;
    text-align: center;
}

.screen-description {
    font-size: 14px;
    color: #333;
    line-height: 1.7;
}

/* カード */
.card-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.card {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 16px;
}

.card:has(.card-row) {
    display: grid;
    grid-template-columns: auto auto;
    gap: 10px 4px;
    justify-content: center;
}

.card-title {
    font-size: 16px;
    font-weight: bold;
    color: #1a1a1a;
}

.card-row {
    display: contents;
}

.card-label {
    font-size: 14px;
    font-weight: normal;
    color: #333;
    white-space: nowrap;
}

.card-value {
    font-size: 14px;
    color: #333;
    word-break: break-all;
}

/* フォーム */
form:has(.form-group) {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.form-group label {
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

.form-group input[type="text"],
.form-group input[type="email"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #bbb;
    border-radius: 6px;
    font-size: 16px;
    outline: none;
    background-color: #fff;
    transition: border-color 0.2s;
}

.form-group input:focus {
    border-color: #1565c0;
    box-shadow: 0 0 0 2px rgba(21, 101, 192, 0.15);
}

.form-group input[readonly] {
    background-color: #f0f0f0;
    color: #666;
}

.input-with-camera {
    display: flex;
    gap: 8px;
    align-items: center;
}

.input-with-camera input {
    flex: 1;
}

.btn-camera {
    width: 44px;
    height: 44px;
    min-width: 44px;
    background: #e8e8e8;
    border: 1px solid #bbb;
    border-radius: 6px;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.btn-camera img {
    width: 28px;
    height: 28px;
}

.btn-camera:active {
    background: #d0d0d0;
}

.btn-camera--uploaded {
    background: #d4edda;
    border-color: #28a745;
}

.camera-file-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}


.camera-thumb {
    width: 44px;
    height: 44px;
    min-width: 44px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #ccc;
    flex-shrink: 0;
}

.required {
    color: #d32f2f;
}

.checkbox-group {
    margin-top: 4px;
}

.checkbox-group a {
    color: #1565c0;
    text-decoration: none;
}

.checkbox-group label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 14px;
    font-weight: normal;
    cursor: pointer;
    color: #333;
}

.checkbox-group input[type="checkbox"] {
    margin-top: 2px;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    accent-color: #1565c0;
}

/* ボタン */
.btn {
    display: block;
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.2s;
    line-height: 1.4;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-primary {
    background-color: #1565c0;
    color: #fff;
}

.btn-primary:active {
    background-color: #0d47a1;
}

.btn-secondary {
    background-color: #f3f3f3;
    color: #333;
    border: 1px solid #bbb;
}

.btn-secondary:active {
    background-color: #f5f5f5;
}

/* メーカー選択ボタン */
.btn-maker {
    background-color: #fff;
    color: #333;
    border: 1px solid #bbb;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    font-size: 15px;
    font-weight: normal;
}

.btn-maker:active {
    background-color: #f0f4f8;
}

.button-group {
    display: flex;
    gap: 12px;
}

.button-group .btn {
    flex: 1;
}

.maker-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 情報リスト（旧スタイル、後方互換） */
.info-list {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px 16px;
    font-size: 14px;
}

.info-list dt {
    font-weight: bold;
    color: #555;
}

.check-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 14px;
    color: #333;
}

/* リンク */
.link-external {
    color: #1565c0;
    font-size: 14px;
    text-decoration: underline;
}

/* フィールドエラー */
.field-error {
    color: #d32f2f;
    font-size: 13px;
    margin-top: 2px;
}

/* フィールドヒント */
.field-hint {
    color: #666;
    font-size: 13px;
    margin-left: 5px;
}

/* エラー・メッセージ */
.error-message {
    color: #d32f2f;
    font-size: 14px;
    padding: 8px 12px;
    background-color: #ffebee;
    border-radius: 4px;
    border-left: 4px solid #d32f2f;
}

.info-message {
    font-size: 13px;
    color: #555;
    background-color: #f5f5f5;
    padding: 12px;
    border-radius: 4px;
    line-height: 1.7;
}

/* モーダル */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 16px;
}

.modal {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    width: 100%;
    max-width: 360px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-error-message {
    font-size: 14px;
    color: #d32f2f;
    text-align: center;
}

/* 完了画面 */
.screen-complete {
    align-items: center;
    padding-top: 20px;
    gap: 16px;
}

.complete-icon-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: #e8f5e9;
    border: 2px solid #4caf50;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.complete-icon-circle svg {
    width: 40px;
    height: 40px;
}

.complete-message {
    font-size: 16px;
    color: #333;
    line-height: 1.8;
    text-align: center;
}

.complete-divider {
    width: 100%;
    border: none;
    border-top: 1px solid #bbb;
    margin: 4px 0;
}

.complete-label {
    font-size: 14px;
    color: #555;
    text-align: center;
}

.management-number-box {
    width: 100%;
    border: 1px solid #bbb;
    border-radius: 6px;
    padding: 14px 16px;
    font-size: 15px;
    color: #333;
    background-color: #fff;
    text-align: left;
}

/* エラー画面 */
.screen-error {
    align-items: center;
    padding-top: 8px;
    gap: 16px;
}

.error-screen-subtitle {
    font-size: 14px;
    color: #d32f2f;
    text-align: center;
    width: 100%;
}

.error-icon-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: #ffebee;
    border: 2px solid #ef5350;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.error-icon-circle svg {
    width: 40px;
    height: 40px;
}

.error-title {
    color: #d32f2f;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    width: 100%;
}

.system-error-box {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.system-error-label {
    font-size: 13px;
    color: #555;
}

.system-error-message {
    font-size: 14px;
    color: #333;
    background-color: #ffebee;
    border: 1px solid #ef9a9a;
    padding: 12px;
    border-radius: 4px;
    width: 100%;
    min-height: 80px;
    line-height: 1.6;
}

.error-guide-message {
    font-size: 14px;
    color: #333;
    line-height: 1.7;
    width: 100%;
}

.contact-info {
    font-size: 14px;
    color: #333;
    background-color: #f5f5f5;
    padding: 16px;
    border-radius: 8px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 4px;
    line-height: 1.7;
}

.contact-info-title {
    font-weight: bold;
    margin-bottom: 4px;
}
