﻿:root {
    /* コーポレーションカラー */
    --morning-blue: rgb(81, 143, 204);
    --bright-green: rgb(17, 168, 78);
    /* 配色1 */
    --primary-color: var(--morning-blue);
    --primary-hover: rgb(66, 122, 180);
    --primary-focus: #518fcc44;
    /* 配色2 */
    --secondary-color: #73b52d;
    --secondary-hover: #5d9424;
    --secondary-focus: #73b52d44;
    /* 配色3 */
    --tertiary-color: var(--bright-green);
    /* --tertiary-hover: #5d9424;
    --tertiary-focus: #73b52d44;*/
    /* 配色（危険）*/
    --danger-color: #dc3545;
    /* 配色（エラー）*/
    --error-color: #e53e3e;
    --error-hover: #c53030;
    --error-focus: #e53e3e44;
    --error-bg-color: #fff5f5;
    /* 文字 */
    --text-main: #333333;
    --text-sub: #666666;
    /* 背景色 */
    --bg-color: #f8fafc;
    /* ボーダー */
    --border-color: #e2e8f0;
    --border-radius: 12px;
    --input-focus: #518fcc44;
    /* 余白 */
    --space-xs: 0.25rem;
    --space-s: 0.5rem;
    --space-m: 1rem;
    --space-l: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    --space-4xl: 5rem;
    --space-5xl: 6rem;
    /* ヘッダー高さ */
    --header-height: 2rem;
}

/*==============================
    初期化
==============================*/
.aspNetHidden {
    position: absolute;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-size: 1rem;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html {
    font-size: 16px;
    font-family: "Noto Sans JP","Hiragino Kaku Gothic ProN", "Meiryo", "sans-serif";
    scroll-behavior: smooth;
}

body {
    /* 画面の高さいっぱいに広げ、中身次第で伸びる */
    min-height: 100dvh;
    /* 親要素(html)に対して幅100%確保。100vwによるスクロールバーの重なりを防止。 */
    width: 100%;
    /* レイアウト */
    display: flex;
    flex-direction: column;
    /* フォントの基本設定 */
    font-size: 1rem;
    font-weight: normal;
    line-height: 1.5;
    color: var(--text-main);
    /* その他 */
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-size: 1rem;
    font-weight: normal;
    line-height: 1;
}

ul, ol {
    list-style: none;
}

a {
    text-decoration: none;
    color: inherit;
}

img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
    height: auto;
}

input, button, textarea, select {
    /* iOSのデフォルトスタイル（勝手なグラデーションや丸み）を解除 */
    -webkit-appearance: none;
    appearance: none;
}

/*==============================
    ページ
==============================*/
.page-container,
.page-wrapper,
.page-main {
    width: 100%;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    gap: var(--space-l);
}

.page-container {
    padding: 0 var(--space-l);
}

.page-header {
    width: 100%;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    margin-top: var(--space-l);
}

.page-header h2 {
    color: var(--text-main);
    font-size: 1.2rem;
    font-weight: bold;
    letter-spacing: 0.1em;
}

.page-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    gap: var(--space-m);
}

.page-footer {
    flex-shrink: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 2rem;
    background-color: #fff;
}

/*==============================
    エラーパネル
==============================*/
.error-panel .panel-container {
    margin-bottom: var(--space-m);
}

.error-panel .panel-wrapper {
    display: flex;
    align-items: center;
    padding: var(--space-s) var(--space-m);
    border: 2px solid var(--error-color);
    border-radius: var(--border-radius);
    background-color: var(--error-bg-color);
}

.error-panel .error-text {
    color: var(--error-color);
    font-weight: 600;
}

/*==============================
    バリデーション
==============================*/
.field-validation span {
    color: var(--error-color);
    font-size: 0.85rem;
    font-weight: 600;
    padding-left: var(--space-xs);
    /* animation: slideIn 0.3s ease-out; */
}

.field-validation span::before {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    content: "\f057";
    display: inline-block;
    margin-right: var(--space-xs);
    font-size: 0.85rem;
    line-height: 0;
}

/*==============================
    ボタン
==============================*/
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 600;
    padding: 0.75rem 1rem;
    height: 48px;
    border-radius: var(--border-radius);
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    border: none;
}

.button i {
    font-size: 1rem;
    margin-right: var(--space-xs)
}

.button-primary {
    background-color: var(--primary-color);
    color: white;
}

.button-secondary {
    background-color: var(--secondary-color);
    color: white;
    min-width: 76px;
}

.button-tertiary {
    background-color: var(--tertiary-color);
    color: white;
}

.button-danger {
    background-color: var(--danger-color);
    color: white;
}

.button-back {
    display: flex;
    justify-content: center;
    line-height: 1;
    background-color: #fff;
    color: var(--text-sub);
    border: 1px solid var(--morning-blue);
}

.button-back:hover {
    background-color: #f8fafc;
}

.button-dummy {
    width: 0;
    height: 0;
    position: absolute;
    opacity: 0;
    border: none;
    padding: 0;
    margin: 0;
    pointer-events: none;
}

/*==============================
    input 系フィールド
==============================*/
.field-container {
    background-color: #fff;
}

.field-label {
    font-size: 1.2rem;
    padding-left: var(--space-s);
    margin-bottom: var(--space-s);
}

.field-label label,
.field-label span {
    font-weight: bold;
    color: var(--text-main);
    display: block;
}

.field-body .field-control {
    padding: 0 var(--space-xs);
}

.field-body input[type="text"],
.field-body input[type="date"],
.field-body input[type="number"],
.field-body input[type="tel"],
.field-body select {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: #ffffff;
    transition: all 0.2s;
    appearance: none;
}

.field-body input:focus {
    outline: none;
    border-color: var(--morning-blue);
    background-color: #fff;
    box-shadow: 0 0 0 4px var(--primary-focus);
}

/*==============================
    ラジオボタンフィールド
==============================*/
.radio-button-field .field-control span {
    width: 100%;
    display: flex;
    gap: 8px;
}

.radio-button-field .field-control span input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-button-field .field-control label {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    padding: var(--space-s);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-sub);
    background-color: #ffffff;
    border: 1.5px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    /*    transition: all 0.2s ease;*/
    white-space: nowrap;
}

.radio-button-field .field-control input[type="radio"]:checked + label {
    border: 2px solid var(--morning-blue);
    color: var(--morning-blue);
    background-color: rgba(81, 143, 204, 0.05);
    /*    box-shadow: 0 4px 12px rgba(81, 143, 204, 0.3);*/
}

.item-row {
    display: flex;
    /*    gap: 8px;*/
    align-items: center;
}

/*@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}*/

/*==============================
    リストビュー
==============================*/
.listview-wrapper,
.listview-container {
    display: flex;
    flex-direction: column;
/*    flex: 1;*/
    overflow: hidden;
}

.listview-wrapper {
    min-height: 300px;
}

.listview {
    display: grid;
    grid-template-columns: 1fr auto;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    --webkit-scrollbar: none;
    scrollbar-width: none;
}

.listview .listview-head,
.listview .listview-body {
    display: contents;
}

.listview .listview-header,
.listview .listview-item {
    display: grid;
    grid-template-columns: subgrid;
    grid-column: 1 / -1;
}

.listview .listview-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: var(--morning-blue);
}

.listview .listview-item .item-actions {
    display: flex;
    flex-direction: row;
    gap: var(--space-s);
}

/* デザイン */
.listview {
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.listview .listview-header {
    flex-shrink: 0;
    padding: var(--space-m) var(--space-xl);
    background-color: var(--morning-blue);
    border: 1px solid var(--morning-blue);
    border-bottom: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    border-bottom-right-radius: unset;
    border-bottom-left-radius: unset;
}

.listview .listview-header span {
    font-weight: bold;
    color: #fff;
    letter-spacing: 0.05em;
}

.listview .listview-item {
    padding: var(--space-m) var(--space-xl);
    border: 1px solid var(--border-color);
    border-top: none;
    transition: background-color 0.2s ease;
    align-items: center;
}

.listview .listview-item:last-child {
    border-bottom: none;
}

/*========================================
    IPアドレス&ポート番号フィールド
========================================*/
.ipaddr-and-portnum-field,
.ipaddr-and-portnum-field .field-container,
.ipaddr-and-portnum-field .field-wrapper,
.ipaddr-and-portnum-field .field-body,
.ipaddr-and-portnum-field .field-controls {
    display: flex;
    flex-direction: column;
}

.ipaddr-and-portnum-field .field-body {
    background-color: #f4f7f9;
    padding: var(--space-s) var(--space-s);
    border-radius: var(--border-radius);
}

.ipaddr-and-portnum-field .field-controls {
    flex-direction: row;
}

.ipaddr-and-portnum-field .field-control.ip-address {
    flex: 3;
}

.ipaddr-and-portnum-field .field-control.port-number {
    flex: 2;
}