:root {
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    --bg-card: rgba(255, 255, 255, 0.05);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #ff5e7e;
    --font-family: 'Outfit', 'Noto Sans JP', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-family);
    background: var(--bg-gradient);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 16px;
}

.phone-container {
    width: 100%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ヘッダー */
.app-header {
    text-align: center;
    padding: 24px 0 10px;
}

.header-icon {
    font-size: 40px;
    color: var(--accent-color);
    margin-bottom: 8px;
    text-shadow: 0 0 12px rgba(255, 94, 126, 0.4);
}

.app-header h1 {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.app-header p {
    font-size: 13px;
    color: var(--text-secondary);
}

/* フォームのコンテナ */
.form-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* 入力グループ */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.row-group {
    display: flex;
    gap: 14px;
}

.row-group .input-group {
    flex: 1;
}

label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

label .material-icons-round {
    font-size: 16px;
    color: var(--accent-color);
}

label .required {
    color: #ef4444;
}

/* 入力要素 */
input[type="text"],
input[type="date"],
input[type="time"],
textarea {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px;
    font-family: var(--font-family);
    color: var(--text-primary);
    font-size: 15px;
    width: 100%;
    outline: none;
    transition: all 0.3s ease;
}

input[type="text"]::placeholder,
textarea::placeholder {
    color: #4b5563;
}

input[type="text"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
textarea:focus {
    border-color: var(--accent-color);
    background: rgba(0, 0, 0, 0.3);
    box-shadow: 0 0 0 3px rgba(255, 94, 126, 0.15);
}

textarea {
    resize: none;
}

/* カラーピッカー */
.color-picker {
    display: flex;
    gap: 12px;
    padding: 4px 0;
}

.color-option {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: var(--color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
}

.color-option:active {
    transform: scale(0.9);
}

.color-option input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid white;
    opacity: 0;
    transition: all 0.2s ease;
}

.color-option.active .checkmark {
    opacity: 1;
}

/* 送信ボタン */
.submit-button {
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 14px;
    padding: 16px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    box-shadow: 0 6px 20px rgba(255, 94, 126, 0.4);
    transition: all 0.2s;
}

.submit-button:active {
    transform: scale(0.98);
    box-shadow: 0 3px 10px rgba(255, 94, 126, 0.2);
}

.icon-send {
    font-size: 18px;
}

/* 送信完了トースト */
.success-toast {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 1;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.success-toast.hidden {
    opacity: 0;
    pointer-events: none;
}

.toast-content {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 30px;
    width: 80%;
    max-width: 320px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    transform: scale(1);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.success-toast.hidden .toast-content {
    transform: scale(0.8);
}

.toast-icon {
    font-size: 60px;
    color: #10b981;
    text-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}

.toast-content h3 {
    font-size: 18px;
    font-weight: 700;
}

.toast-content p {
    font-size: 13px;
    color: var(--text-secondary);
}

/* 認証画面 (パスコードログイン) */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px;
    opacity: 1;
    transition: opacity 0.35s ease;
}

.auth-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.auth-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 32px 24px;
    width: 100%;
    max-width: 360px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    transform: scale(1);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.auth-overlay.hidden .auth-card {
    transform: scale(0.9);
}

.auth-icon {
    font-size: 48px;
    color: var(--accent-color);
    margin-bottom: 8px;
    filter: drop-shadow(0 0 12px rgba(255, 94, 126, 0.4));
}

.auth-header h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 6px;
}

.auth-header p {
    font-size: 13px;
    color: var(--text-secondary);
}

.auth-error {
    color: #f87171;
    font-size: 12px;
    font-weight: 600;
    background: rgba(239, 68, 68, 0.15);
    padding: 10px;
    border-radius: 10px;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.auth-error.hidden {
    display: none;
}

/* ヘッダー上部・設定ボタン */
.header-top {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 100%;
}

.settings-btn {
    position: absolute;
    right: 0;
    top: 0;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.settings-btn:active {
    transform: scale(0.9);
    background: rgba(255, 255, 255, 0.15);
}

/* 設定モーダル */
.settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 150;
    padding: 20px;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.settings-modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.settings-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 28px 20px;
    width: 100%;
    max-width: 360px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.settings-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--accent-color);
}

.settings-card p {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.settings-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: var(--text-primary);
    padding: 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

/* 認証画面内のURL設定セクション */
.auth-url-section {
    width: 100%;
    margin-bottom: 8px;
}

.auth-url-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    color: var(--text-secondary);
    padding: 10px 14px;
    font-size: 13px;
    cursor: pointer;
    font-family: var(--font-outfit);
    transition: all 0.2s;
    text-align: left;
}

.auth-url-toggle .toggle-arrow {
    margin-left: auto;
    transition: transform 0.2s;
}

.auth-url-toggle.open .toggle-arrow {
    transform: rotate(180deg);
}

.auth-url-toggle:active {
    background: rgba(255, 255, 255, 0.08);
}

.auth-url-box {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.auth-url-box.hidden {
    display: none;
}

.auth-url-hint {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.auth-url-hint code {
    background: rgba(255,255,255,0.1);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 11px;
}
