/**
 * public/css/public.css
 * フロントエンド用スタイルシート（スマホ専用UI）
 * 
 * @since 1.0.0
 */

/* リセット */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* 基本設定 */
.unmanned-stores-page {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Yu Gothic", YuGothic, 
                 "ヒラギノ角ゴ ProN W3", Hiragino Kaku Gothic ProN, Arial, "メイリオ", Meiryo, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* アプリコンテナ */
.us-app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.us-main {
    flex: 1;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    background: #fff;
    min-height: 100vh;
}

/* ヘッダー */
.us-header {
    background: #0073aa;
    color: #fff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.us-header h1 {
    font-size: 20px;
    margin: 0;
    font-weight: 600;
}

.us-back-link {
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* コンテナ */
.us-entry-container,
.us-auth-container,
.us-mypage-container,
.us-monthly-container,
.us-shop-container {
    padding: 0;
    background: #fff;
    min-height: 100vh;
}

.us-auth-container {
    padding: 20px;
}

/* セクション */
.us-section {
    padding: 20px;
    border-bottom: 8px solid #f5f5f5;
}

.us-section h2 {
    font-size: 18px;
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.us-section h3 {
    font-size: 16px;
    margin: 0 0 12px 0;
}

/* カード */
.us-status-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    margin-bottom: 20px;
}

.us-status-card.us-status-active {
    background: #e8f5e9;
    border: 2px solid #4caf50;
}

.us-status-icon {
    font-size: 48px;
    color: #666;
    margin-bottom: 12px;
}

.us-status-active .us-status-icon {
    color: #4caf50;
}

/* ボタン */
.us-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.us-button:active {
    transform: scale(0.98);
}

.us-button-primary {
    background: #0073aa;
    color: #fff;
}

.us-button-primary:hover {
    background: #005a87;
}

.us-button-secondary {
    background: #666;
    color: #fff;
}

.us-button-secondary:hover {
    background: #555;
}

.us-button-danger {
    background: #dc3545;
    color: #fff;
}

.us-button-danger:hover {
    background: #c82333;
}

.us-button-large {
    padding: 16px 32px;
    font-size: 18px;
}

.us-button-block {
    width: 100%;
}

/* バッジ */
.us-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.us-badge-monthly {
    background: #0073aa;
    color: #fff;
}

.us-badge-active {
    background: #4caf50;
    color: #fff;
}

/* 会員情報 */
.us-member-info {
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.us-member-greeting h2 {
    font-size: 20px;
    margin: 0 0 8px 0;
}

.us-member-id {
    color: #666;
    font-size: 14px;
}

/* 入退場状態 */
.us-checked-in,
.us-not-checked-in {
    padding: 20px;
}

.us-entry-time,
.us-duration,
.us-current-fee {
    margin: 12px 0;
    font-size: 16px;
}

.us-timer {
    font-size: 36px;
    font-weight: bold;
    color: #dc3545;
    display: block;
    margin: 8px 0;
}

.us-fee {
    font-size: 32px;
    font-weight: bold;
    color: #0073aa;
    display: block;
    margin: 8px 0;
}

.us-monthly-notice {
    background: #e3f2fd;
    color: #1976d2;
    padding: 12px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 16px 0;
}

/* QRコード */
.us-qr-section {
    margin: 20px 0;
}

.us-qr-display {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

#us-qr-code {
    margin: 0 auto;
}

.us-qr-instruction {
    margin-top: 12px;
    color: #666;
    font-size: 14px;
}

/* クイックアクション */
.us-quick-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 20px;
    background: #f8f9fa;
}

.us-action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 8px;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    transition: all 0.2s;
}

.us-action-card:active {
    transform: scale(0.98);
    background: #f8f9fa;
}

.us-action-card i {
    font-size: 24px;
    color: #0073aa;
}

/* 施設状況 */
.us-facility-status {
    padding: 20px;
    background: #fff;
    border-top: 1px solid #e9ecef;
}

.us-facility-status h3 {
    font-size: 16px;
    margin: 0 0 12px 0;
}

.us-status-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
}

.us-current-users {
    font-size: 24px;
    font-weight: bold;
    color: #0073aa;
}

/* フォーム */
.us-form-group {
    margin-bottom: 20px;
}

.us-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.us-form-group input[type="text"],
.us-form-group input[type="email"],
.us-form-group input[type="tel"],
.us-form-group input[type="password"],
.us-form-group input[type="date"],
.us-form-group input[type="number"],
.us-form-group select,
.us-form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-size: 16px;
    background: #fff;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.us-form-group input:focus,
.us-form-group select:focus,
.us-form-group textarea:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.us-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.us-checkbox-group label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-weight: normal;
    cursor: pointer;
}

.us-checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    flex-shrink: 0;
}

.us-required {
    color: #dc3545;
}

.us-form-help {
    font-size: 14px;
    color: #666;
    margin-top: 4px;
}

.us-form-section {
    margin-bottom: 32px;
}

.us-form-section h3 {
    font-size: 18px;
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* パスワード表示トグル */
.us-form-group {
    position: relative;
}

.us-password-toggle {
    position: absolute;
    right: 12px;
    top: 36px;
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 8px;
}

/* 認証画面 */
.us-auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.us-auth-header h1 {
    font-size: 24px;
    margin: 0 0 8px 0;
    color: #0073aa;
}

.us-auth-header p {
    color: #666;
    margin: 0;
}

.us-auth-form {
    max-width: 400px;
    margin: 0 auto;
}

.us-auth-divider {
    text-align: center;
    margin: 32px 0;
    position: relative;
}

.us-auth-divider span {
    background: #fff;
    padding: 0 16px;
    color: #666;
    font-size: 14px;
}

.us-auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e9ecef;
}

.us-auth-alternative {
    text-align: center;
}

.us-auth-alternative p {
    margin-bottom: 16px;
    color: #666;
}

.us-form-links {
    text-align: center;
    margin-top: 16px;
}

.us-link {
    color: #0073aa;
    text-decoration: none;
    font-size: 14px;
}

.us-link:hover {
    text-decoration: underline;
}

/* メッセージ */
.us-message {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0;
    font-size: 14px;
}

.us-message-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.us-message-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* モーダル */
.us-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.us-modal-content {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
}

.us-modal-content h3 {
    margin: 0 0 20px 0;
    font-size: 20px;
}

.us-modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.us-modal-actions .us-button {
    flex: 1;
}

/* 決済関連 */
.us-checkout-summary,
.us-payment-summary {
    margin-bottom: 24px;
}

.us-fee-details {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.us-fee-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
}

.us-fee-total {
    font-weight: bold;
    font-size: 18px;
    border-top: 1px solid #dee2e6;
    margin-top: 8px;
    padding-top: 12px;
}

.us-payment-methods h4 {
    font-size: 16px;
    margin: 0 0 16px 0;
}

.us-payment-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.us-payment-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.us-payment-option:hover {
    border-color: #0073aa;
    background: #e3f2fd;
}

.us-payment-option.active {
    border-color: #0073aa;
    background: #e3f2fd;
}

.us-payment-option i {
    font-size: 32px;
    color: #0073aa;
}

/* 確認番号入力 */
.us-confirmation-code {
    text-align: center;
}

.us-code-input {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin: 24px 0;
}

.us-code-input input {
    width: 60px;
    height: 60px;
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    border: 2px solid #ced4da;
    border-radius: 8px;
}

.us-code-input input:focus {
    border-color: #0073aa;
    outline: none;
}

/* 商品購入画面 */
.us-scanner-area {
    margin-bottom: 24px;
}

.us-scanner-viewport {
    position: relative;
    width: 100%;
    height: 300px;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
}

.us-scanner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.us-scanner-frame {
    width: 250px;
    height: 250px;
    border: 2px solid #0073aa;
    border-radius: 8px;
}

.us-scanner-controls {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.us-manual-input {
    text-align: center;
    padding: 20px 0;
    border-top: 1px solid #e9ecef;
}

.us-manual-input p {
    margin-bottom: 12px;
    color: #666;
}

.us-input-group {
    display: flex;
    gap: 8px;
    max-width: 300px;
    margin: 0 auto;
}

.us-input-group input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-size: 16px;
}

/* 商品情報 */
.us-product-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
}

.us-product-name {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 8px;
}

.us-product-price {
    font-size: 24px;
    color: #0073aa;
    font-weight: bold;
    margin-bottom: 8px;
}

.us-product-stock {
    color: #666;
    margin-bottom: 16px;
}

.us-quantity-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.us-quantity-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.us-quantity-btn {
    width: 36px;
    height: 36px;
    border: 1px solid #ced4da;
    background: #fff;
    border-radius: 4px;
    font-size: 20px;
    cursor: pointer;
}

.us-quantity-controls input {
    width: 60px;
    height: 36px;
    text-align: center;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 16px;
}

/* カート */
.us-empty-cart {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.us-empty-cart i {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
}

.us-cart-item {
    padding: 16px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 12px;
}

.us-item-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.us-item-name {
    font-weight: 600;
}

.us-item-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.us-remove-item {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    padding: 8px;
}

.us-item-subtotal {
    text-align: right;
    color: #666;
    font-size: 14px;
}

.us-cart-summary {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    margin-top: 20px;
}

.us-cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 16px;
}

/* マイページ */
.us-info-card {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 8px;
}

.us-info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.us-info-row:last-child {
    border-bottom: none;
}

.us-info-label {
    color: #666;
}

.us-info-value {
    font-weight: 600;
}

.us-action-box {
    background: #e3f2fd;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    margin-top: 16px;
}

.us-action-box p {
    margin-bottom: 12px;
}

/* 履歴 */
.us-history-list {
    margin-top: 16px;
}

.us-history-item {
    padding: 16px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 12px;
}

.us-history-date {
    font-weight: 600;
    margin-bottom: 8px;
}

.us-history-details {
    color: #666;
    font-size: 14px;
}

.us-history-time {
    margin-bottom: 4px;
}

.us-history-duration,
.us-history-fee {
    display: inline-block;
    margin-right: 16px;
}

/* 空状態 */
.us-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.us-empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
}

/* 危険ゾーン */
.us-danger-zone {
    background: #fee;
    border: 1px solid #fcc;
}

.us-danger-zone h2 {
    color: #dc3545;
}

/* 月会員画面 */
.us-monthly-status {
    text-align: center;
    padding: 32px 20px;
}

.us-monthly-status .us-status-icon {
    font-size: 64px;
    color: #ffc107;
    margin-bottom: 16px;
}

.us-status-active {
    color: #4caf50;
    font-size: 20px;
    font-weight: bold;
}

.us-monthly-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    margin-top: 24px;
}

.us-monthly-benefits {
    margin: 24px 0;
}

.us-benefit-list {
    list-style: none;
    padding: 0;
    margin: 16px 0;
}

.us-benefit-list li {
    padding: 12px 0;
    padding-left: 32px;
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
}

.us-benefit-list li i {
    position: absolute;
    left: 0;
    color: #4caf50;
}

.us-renewal-notice {
    background: #fff3cd;
    color: #856404;
    padding: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
}

.us-monthly-promotion {
    text-align: center;
    padding: 32px 20px;
}

.us-promo-icon {
    font-size: 64px;
    color: #ffc107;
    margin-bottom: 16px;
}

.us-pricing-cards {
    margin: 32px 0;
}

.us-pricing-card {
    background: #f8f9fa;
    padding: 32px;
    border-radius: 12px;
    text-align: center;
    border: 2px solid #e9ecef;
}

.us-pricing-card.us-featured {
    border-color: #0073aa;
    background: #e3f2fd;
}

.us-pricing-card h3 {
    margin: 0 0 20px 0;
    font-size: 20px;
}

.us-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
    margin-bottom: 8px;
}

.us-currency {
    font-size: 20px;
}

.us-amount {
    font-size: 36px;
    font-weight: bold;
    color: #0073aa;
}

.us-period {
    font-size: 16px;
    color: #666;
}

.us-price-note {
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
}

.us-pricing-info {
    text-align: center;
    margin-top: 16px;
    color: #666;
    font-size: 14px;
}

.us-monthly-faq {
    margin-top: 32px;
}

.us-faq-item {
    margin-bottom: 20px;
}

.us-faq-item h4 {
    font-size: 16px;
    margin: 0 0 8px 0;
}

.us-faq-item p {
    color: #666;
    margin: 0;
}

/* ローディング */
.us-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.us-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: us-spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes us-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.us-loading-overlay p {
    color: #fff;
    font-size: 16px;
}

/* ユーティリティ */
.us-text-danger {
    color: #dc3545;
}

.us-text-success {
    color: #28a745;
}

.us-text-muted {
    color: #666;
}

/* レスポンシブ */
@media (max-width: 480px) {
    .us-main {
        max-width: 100%;
    }
    
    .us-modal-content {
        margin: 0;
        border-radius: 16px 16px 0 0;
        max-height: 85vh;
    }
}

/* 印刷対応 */
@media print {
    .us-header,
    .us-quick-actions,
    .us-button,
    .us-scanner-area {
        display: none !important;
    }
}

/* アクセシビリティ */
.us-button:focus,
.us-action-card:focus,
.us-link:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* ダークモード対応（将来実装） */
@media (prefers-color-scheme: dark) {
    /* ダークモード用スタイル */
}