/**
 * TP2E Member Registration Styles for Greenly Theme
 * 整合 Greenly 主題設計風格的會員註冊樣式
 */

/* 變數定義 - Light Theme 配色 */
:root {
    --tp2e-primary-color: #27ae60;     /* 淺綠色 */
    --tp2e-secondary-color: #95a5a6;   /* 淺灰色 */
    --tp2e-accent-color: #e74c3c;      /* 保持紅色用於必填提示 */
    --tp2e-text-color: #2c3e50;        /* 深灰文字 */
    --tp2e-light-gray: #f8f9fa;        /* 極淺灰 */
    --tp2e-white: #ffffff;             /* 純白 */
    --tp2e-border-color: #e9ecef;      /* 淺灰邊框 */
    --tp2e-hover-color: #2ecc71;       /* 懸停時的綠色 */
    --tp2e-border-radius: 12px;        /* 圓角半徑 */
    --tp2e-box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    --tp2e-transition: all 0.3s ease;
}

/* 主容器 - Light Theme 簡潔風格 */
.tp2e-register-container {
    max-width: 900px;
    margin: 40px auto;
    background: transparent;
    border-radius: var(--tp2e-border-radius);
    box-shadow: none;
    overflow: visible;
    position: relative;
    padding: 0;
}

/* 卡片樣式變體 */
.tp2e-register-container.tp2e-style-card {
    border: 1px solid var(--tp2e-border-color);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.tp2e-register-container.tp2e-style-minimal {
    box-shadow: none;
    border: 1px solid var(--tp2e-border-color);
}

/* 表單標題區域 - 簡潔風格 */
.tp2e-form-header {
    background: var(--tp2e-white);
    color: var(--tp2e-text-color);
    padding: 40px 20px 20px;
    text-align: center;
    position: relative;
    border: 1px solid var(--tp2e-border-color);
    border-radius: var(--tp2e-border-radius);
    margin-bottom: 20px;
}

.tp2e-form-header::after {
    display: none;
}

.tp2e-form-title {
    margin: 0;
    font-size: 2.2rem;
    font-weight: 600;
    color: var(--tp2e-text-color);
    text-shadow: none;
}

/* 會員類型選擇器 */
.tp2e-member-type-selector {
    padding: 30px 20px;
    background: var(--tp2e-white);
    border: 1px solid var(--tp2e-border-color);
    border-radius: var(--tp2e-border-radius);
    margin-bottom: 20px;
}

.tp2e-selector-title {
    text-align: center;
    color: var(--tp2e-text-color);
    margin-bottom: 30px;
    font-size: 1.4rem;
    font-weight: 500;
}

.tp2e-type-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;
}

/* 響應式調整 - 在較小螢幕上單欄顯示 */
@media (max-width: 768px) {
    .tp2e-type-options {
        grid-template-columns: 1fr;
        max-width: 400px;
    }
}

.tp2e-type-option {
    background: var(--tp2e-white);
    border: 1px solid var(--tp2e-border-color);
    border-radius: var(--tp2e-border-radius);
    padding: 16px 12px;
    cursor: pointer;
    transition: var(--tp2e-transition);
    text-align: center;
    position: relative;
    overflow: hidden;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.tp2e-type-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
    transition: left 0.5s;
}

.tp2e-type-option:hover::before {
    left: 100%;
}

.tp2e-type-option:hover {
    border-color: var(--tp2e-hover-color);
    box-shadow: var(--tp2e-box-shadow);
    transform: translateY(-2px);
}

.tp2e-type-option input[type="radio"] {
    display: none;
}

.tp2e-type-option input[type="radio"]:checked + .tp2e-option-label,
.tp2e-type-option input[type="radio"]:checked ~ .tp2e-option-desc {
    color: var(--tp2e-primary-color);
}

.tp2e-type-option.selected {
    border-color: var(--tp2e-primary-color);
    background: rgba(39, 174, 96, 0.05);
    box-shadow: 0 2px 12px rgba(39, 174, 96, 0.15);
}

.tp2e-option-label {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    margin: 8px 0 0 0;
    color: var(--tp2e-text-color);
    transition: var(--tp2e-transition);
}

.option-icon {
    margin-bottom: 8px;
    font-size: 1.2rem;
    color: var(--tp2e-secondary-color);
}

.option-icon i {
    font-size: 1.5rem;
}

/* 表單容器 */
.tp2e-forms-container {
    padding: 0;
}

.tp2e-member-form {
    transition: var(--tp2e-transition);
}

/* 表單區段 */
.tp2e-form-section {
    padding: 30px 20px;
    background: var(--tp2e-white);
    border: 1px solid var(--tp2e-border-color);
    border-radius: var(--tp2e-border-radius);
    margin-bottom: 20px;
    position: relative;
}

.tp2e-form-section:last-child {
    margin-bottom: 0;
}

.tp2e-form-section h3 {
    margin: 0 0 25px 0;
    color: var(--tp2e-text-color);
    font-size: 1.6rem;
    font-weight: 600;
    padding: 15px 20px;
    background: var(--tp2e-light-gray);
    border-radius: var(--tp2e-border-radius);
    border: 1px solid var(--tp2e-border-color);
    position: relative;
}

.tp2e-form-section h3::after {
    display: none;
}

.tp2e-form-section h4 {
    margin: 0 0 20px 0;
    color: var(--tp2e-text-color);
    font-size: 1.2rem;
    font-weight: 500;
    padding: 12px 16px;
    background: var(--tp2e-light-gray);
    border-radius: var(--tp2e-border-radius);
    border: 1px solid var(--tp2e-border-color);
}

/* 表單列和群組 */
.tp2e-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.tp2e-form-group {
    margin-bottom: 20px;
}

.tp2e-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--tp2e-text-color);
    font-size: 0.95rem;
}

.tp2e-form-group input,
.tp2e-form-group textarea,
.tp2e-form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--tp2e-border-color);
    border-radius: var(--tp2e-border-radius);
    font-size: 0.95rem;
    transition: var(--tp2e-transition);
    box-sizing: border-box;
    background: white;
}

.tp2e-form-group input:focus,
.tp2e-form-group textarea:focus,
.tp2e-form-group select:focus {
    outline: none;
    border-color: var(--tp2e-primary-color);
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.1);
    transform: translateY(-1px);
}

.tp2e-form-group textarea {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

.required {
    color: var(--tp2e-accent-color);
    font-weight: bold;
    margin-left: 2px;
}

/* 按鈕樣式 - Light Theme 風格 */
.tp2e-form-actions {
    padding: 30px 20px;
    text-align: center;
    background: var(--tp2e-white);
    border: 1px solid var(--tp2e-border-color);
    border-radius: var(--tp2e-border-radius);
    margin-top: 20px;
}

.tp2e-btn {
    display: inline-block;
    padding: 15px 30px;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--tp2e-transition);
    min-width: 150px;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tp2e-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.tp2e-btn:hover::before {
    left: 100%;
}

.tp2e-btn-primary {
    background: var(--tp2e-primary-color);
    color: white;
    box-shadow: var(--tp2e-box-shadow);
    border: 1px solid var(--tp2e-primary-color);
}

.tp2e-btn-primary:hover {
    background: var(--tp2e-hover-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.2);
}

.tp2e-btn-secondary {
    background: var(--tp2e-secondary-color);
    color: white;
    margin-top: 15px;
    margin-left: 10px;
    border: 1px solid var(--tp2e-secondary-color);
}

.tp2e-btn-secondary:hover {
    background: #7f8c8d;
    border-color: #7f8c8d;
    transform: translateY(-1px);
}

.tp2e-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 訊息樣式 */
.tp2e-form-messages {
    margin: 20px 0 0 0;
}

.tp2e-message {
    padding: 15px 20px;
    margin: 10px 0;
    font-weight: 500;
    border: 1px solid;
    border-radius: var(--tp2e-border-radius);
    position: relative;
}

.tp2e-message--success {
    background: rgba(39, 174, 96, 0.1);
    border-color: var(--tp2e-primary-color);
    color: #155724;
}

.tp2e-message--error {
    background: rgba(231, 76, 60, 0.1);
    border-color: var(--tp2e-accent-color);
    color: #721c24;
}

/* 載入狀態 */
.tp2e-loading {
    position: relative;
    opacity: 0.7;
    pointer-events: none;
}

.tp2e-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid var(--tp2e-border-color);
    border-top: 4px solid var(--tp2e-primary-color);
    border-radius: 50%;
    animation: tp2e-spin 1s linear infinite;
    z-index: 1000;
}

@keyframes tp2e-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 團體會員個人會員管理區域 */
.tp2e-org-members-section {
    margin-top: 0;
    padding: 30px;
    background: var(--tp2e-light-gray);
    border-top: 1px solid var(--tp2e-border-color);
}

.tp2e-org-members-section h3 {
    margin-top: 0;
    color: var(--tp2e-text-color);
    border-bottom: 2px solid var(--tp2e-primary-color);
    padding-bottom: 15px;
}

.tp2e-members-list {
    margin-bottom: 25px;
}

.tp2e-member-item {
    background: white;
    padding: 20px;
    border: 1px solid var(--tp2e-border-color);
    border-radius: var(--tp2e-border-radius);
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: var(--tp2e-transition);
}

.tp2e-member-item:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.tp2e-member-item h5 {
    margin: 0 0 10px 0;
    color: var(--tp2e-text-color);
    font-size: 1.1rem;
    font-weight: 600;
}

.tp2e-member-info {
    font-size: 0.9rem;
    color: #6c757d;
    line-height: 1.5;
}

/* 個人會員表單在團體中 */
.tp2e-individual-member-form {
    background: white;
    padding: 25px;
    border: 1px solid var(--tp2e-border-color);
    border-radius: var(--tp2e-border-radius);
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.tp2e-individual-member-form h5 {
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--tp2e-text-color);
    font-size: 1.2rem;
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--tp2e-border-color);
}

/* 響應式設計 */
@media (max-width: 768px) {
    .tp2e-register-container {
        margin: 20px 10px;
        border-radius: 0;
    }
    
    .tp2e-form-header {
        padding: 25px 20px;
    }
    
    .tp2e-form-title {
        font-size: 1.8rem;
    }
    
    .tp2e-type-options {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .tp2e-form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .tp2e-form-section,
    .tp2e-member-type-selector,
    .tp2e-form-actions,
    .tp2e-org-members-section {
        padding: 20px;
    }
    
    .tp2e-btn {
        width: 100%;
        margin: 5px 0;
    }
}

@media (max-width: 480px) {
    .tp2e-form-title {
        font-size: 1.5rem;
    }
    
    .tp2e-form-section h3 {
        font-size: 1.4rem;
    }
    
    .tp2e-form-section h4 {
        font-size: 1.1rem;
        padding: 12px 15px;
    }
    
    .tp2e-type-option {
        padding: 20px 15px;
    }
}

/* 深色模式已停用 - 保持 Light Theme */
@media (prefers-color-scheme: dark) {
    /* 強制使用 Light Theme 即使在深色模式下 */
    :root {
        --tp2e-text-color: #2c3e50;
        --tp2e-light-gray: #f8f9fa;
        --tp2e-border-color: #e9ecef;
        --tp2e-white: #ffffff;
    }
    
    .tp2e-register-container {
        background: transparent;
    }
    
    .tp2e-type-option,
    .tp2e-member-item,
    .tp2e-individual-member-form,
    .tp2e-form-section,
    .tp2e-form-header,
    .tp2e-member-type-selector,
    .tp2e-form-actions {
        background: var(--tp2e-white);
        border-color: var(--tp2e-border-color);
        color: var(--tp2e-text-color);
    }
    
    .tp2e-form-group input,
    .tp2e-form-group textarea,
    .tp2e-form-group select {
        background: var(--tp2e-white);
        border-color: var(--tp2e-border-color);
        color: var(--tp2e-text-color);
    }
}

/* 打印樣式 */
@media print {
    .tp2e-btn,
    .tp2e-form-actions {
        display: none;
    }
    
    .tp2e-register-container {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .tp2e-form-header {
        background: none;
        color: #000;
    }
}

/* 新增會員類型特有的樣式 */
.tp2e-type-permanent .option-icon i {
    color: #ffc107;
}

.tp2e-type-student .option-icon i {
    color: #28a745;
}

.tp2e-type-permanent.selected {
    border-color: #ffc107;
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.05), rgba(255, 193, 7, 0.1));
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.15);
}

.tp2e-type-student.selected {
    border-color: #28a745;
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.05), rgba(40, 167, 69, 0.1));
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.15);
}

.tp2e-type-permanent:hover {
    border-color: #ffc107;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.1);
}

.tp2e-type-student:hover {
    border-color: #28a745;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.1);
}

/* 確保4個選項在桌面上為2x2網格，在手機上為單欄 */
@media (min-width: 769px) {
    .tp2e-type-options {
        grid-template-columns: repeat(2, 1fr);
        max-width: 600px;
    }
}

/* 確保所有文字都是深色，但按鈕除外 */
.tp2e-register-container,
.tp2e-register-container *:not(.tp2e-btn):not(.tp2e-btn *) {
    color: var(--tp2e-text-color) !important;
}

.tp2e-form-header .tp2e-form-title,
.tp2e-form-header p {
    color: var(--tp2e-text-color) !important;
}

.tp2e-option-label,
.tp2e-form-section h3,
.tp2e-form-section h4,
.tp2e-form-group label {
    color: var(--tp2e-text-color) !important;
}

/* 覆蓋任何可能的白色文字 */
.tp2e-register-container .tp2e-form-header {
    color: var(--tp2e-text-color) !important;
}

/* 確保按鈕文字顏色正確 */
.tp2e-btn-primary,
.tp2e-btn-primary * {
    color: white !important;
}

.tp2e-btn-secondary,
.tp2e-btn-secondary * {
    color: white !important;
}

/* 確保必填星號是紅色 */
.required {
    color: var(--tp2e-accent-color) !important;
}

/* 初始載入時的預設顯示狀態由 HTML 和 JavaScript 控制 */
/* 這裡只定義基本的表單樣式 */