/* ===================================================
   阿德莱德大学2025年中国开放日报名表单样式文件
   支持响应式设计和移动端适配
   ================================================== */

/* 重置样式和基础设置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    min-height: 100%;
    font-family: "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #373737;
    background: #f5f7fa;
    background-attachment: fixed;
}

/* 表单容器 */
.form-container {
    max-width: 700px;
    margin: 20px auto;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: visible;
    min-height: auto;
}

/* 表头样式 - 参考金数据2024年表单样式 */
.form-header {
    position: relative;
    text-align: center;
    padding: 0;
    margin: 0;
}

/* Banner图片样式 */
.header-img {
    width: 100%;
    height: auto;
    display: block;
    margin: 0;
    vertical-align: top;
}

/* 活动报名表副标题样式 */
.header-subtitle {
    background: #fff;
    padding: 15px 20px;
    text-align: center;
    margin: 0;
}

.header-subtitle p {
    margin: 0;
    font-size: 16px;
    color: #666;
    font-weight: normal;
    font-family: "DengXian", "Microsoft YaHei", sans-serif;
}

/* 表单主体 */
.form-body {
    padding: 30px 30px;
}

/* 表单区块 */
.form-section {
    margin-bottom: 40px;
    padding: 0;
}

.section-title {
    font-size: 18px;
    font-weight: bold;
    color: #373737;
    margin-bottom: 20px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e9ecef;
    position: relative;
}

.section-title::after {
    display: none;
}

/* 表单行和组 */
.form-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.form-group {
    flex: 1;
    min-width: 300px;
    margin: 0 10px 30px;
}

.form-group.col-6 {
    flex: 0 0 calc(50% - 20px);
    min-width: calc(50% - 20px);
}

.form-group.full-width {
    flex-basis: 100%;
    min-width: auto;
}

/* 标签样式 */
label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #373737;
    font-size: 14px;
    line-height: 1.4;
}

.required label::after {
    content: ' *';
    color: #dc3545;
}

/* 50%宽度字段 */
.form-field-50 {
    width: 50%;
    max-width: 50%;
}

/* 带图标的输入框容器 */
.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.input-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    pointer-events: none;
    opacity: 0.6;
    width: 20px;
    height: 20px;
}

.input-with-icon input[type="text"],
.input-with-icon input[type="email"],
.input-with-icon input[type="tel"] {
    width: 100%;
    padding: 12px 16px 12px 60px !important;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s ease;
    background-color: #fff;
    color: #373737;
    font-family: inherit;
}

/* 输入框样式 */
input[type="text"],
input[type="tel"],
input[type="email"],
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s ease;
    background-color: #fff;
    color: #373737;
    font-family: inherit;
}

/* 字段注释样式 */
.field-note {
    font-size: 12px;
    color: hsl(354, 74%, 57%);
    margin: 5px 0 0 0;
    text-decoration: underline;
}

/* 字段提示样式 */
.field-prompt {
    font-size: 13px;
    color: #666;
    margin: 5px 0 10px 0;
    font-weight: normal;
}

/* 字段描述样式 */
.field-description {
    font-size: 12px;
    color: #333;
    margin: 5px 0 15px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #0066cc;
    font-weight: normal;
}

.field-description p {
    margin: 0 0 8px 0;
}

.field-description p:last-child {
    margin-bottom: 0;
}

.field-description a {
    color: #0066cc;
    text-decoration: underline;
}

.field-description a:hover {
    color: #0052a3;
}

.input-with-icon input:focus,
input[type="text"]:focus,
input[type="tel"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #0066cc;
    background-color: #fff;
}

input[type="text"]:invalid:not(:focus),
input[type="tel"]:invalid:not(:focus),
input[type="email"]:invalid:not(:focus) {
    border-color: #ddd;
}

/* 下拉框样式 */
select.form-control {
    cursor: pointer;
    appearance: none; /* 隐藏浏览器默认下拉箭头 */
    -webkit-appearance: none; /* Safari/Chrome */
    -moz-appearance: none; /* Firefox */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
}

/* 单选框样式 */
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 8px;
}

.radio-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-weight: normal;
    margin-bottom: 0;
}

.radio-label input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 18px;
    height: 18px;
    border: 2px solid #dee2e6;
    border-radius: 50%;
    margin-right: 10px;
    margin-top: 2px;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.radio-label input[type="radio"]:checked + .radio-custom {
    border-color: #0066cc;
    background-color: #0066cc;
}

.radio-label input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

/* 复选框样式 */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 8px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-weight: normal;
    margin-bottom: 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.checkbox-label:hover {
    background: #e9ecef;
    border-color: #0066cc;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 18px;
    height: 18px;
    border: 2px solid #dee2e6;
    border-radius: 4px;
    margin-right: 12px;
    margin-top: 2px;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
    border-color: #0066cc;
    background-color: #0066cc;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: translate(-50%, -50%) rotate(45deg);
}

.checkbox-text {
    flex: 1;
    line-height: 1.4;
    color: #555;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom + .checkbox-text {
    color: #003366;
    font-weight: 500;
}

/* 城市信息详细样式 */
.city-date {
    color: #0066cc;
    font-weight: 500;
    font-size: 13px;
    display: block;
    margin: 2px 0;
}

.city-location {
    color: #666;
    font-size: 12px;
    margin: 4px 0;
    display: block;
    line-height: 1.4;
}

.city-time {
    color: #333;
    font-weight: 500;
    font-size: 13px;
    display: block;
    margin: 2px 0;
}

/* 城市选择样式 */
.cities-selection {
    display: grid;
    gap: 20px;
    margin-top: 15px;
}

.city-option {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    transition: all 0.3s ease;
    background: #fff;
}

.city-option:hover,
.city-option.selected {
    border-color: #0066cc;
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.1);
}

.city-option.selected {
    background: linear-gradient(135deg, #f8fbff 0%, #f0f7ff 100%);
}

.city-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    padding: 20px;
    margin-bottom: 0;
}

.city-label input[type="radio"]:checked + .radio-custom + .city-info {
    background: linear-gradient(135deg, #f0f7ff 0%, #e6f2ff 100%);
    border-radius: 8px;
    padding: 15px;
    margin: -5px;
}

.city-info {
    flex: 1;
    margin-left: 15px;
}

.city-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.city-header strong {
    font-size: 18px;
    color: #003366;
    font-weight: 600;
}

.date-badge {
    background: linear-gradient(135deg, #0066cc 0%, #003366 100%);
    color: #fff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.city-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.detail-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.detail-item .label {
    font-weight: 600;
    color: #666;
    min-width: 80px;
}

.detail-item .value {
    flex: 1;
    color: #333;
    line-height: 1.4;
}

/* 错误消息样式 */
.error-msg {
    display: block;
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
    min-height: 16px;
}

/* 提交按钮区域 */
.form-submit {
    text-align: center;
    margin-top: 40px;
}

.submit-btn {
    background: rgba(10, 10, 57, 1);
    color: #fff;
    border: none;
    padding: 16px 55px;
    font-size: 14px;
    font-weight: normal;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(10, 10, 57, 0.2);
    min-width: 300px;
    text-align: center;
}

.submit-btn:hover {
    background: rgba(8, 8, 45, 1);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(10, 10, 57, 0.3);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.submit-tip {
    margin-top: 15px;
    font-size: 12px;
    color: #6c757d;
    line-height: 1.4;
}

/* 表单底部 */
.form-footer {
    background-color: #f8f9fa;
    padding: 20px;
    text-align: center;
    color: #6c757d;
    font-size: 12px;
    border-top: 1px solid #dee2e6;
}

/* 隐私警告 */
.privacy-warning {
    margin-bottom: 15px;
}

.privacy-warning p {
    margin: 0;
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

/* 品牌信息 */
.powered-by {
    margin-bottom: 20px;
}

.powered-by-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.university-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.university-logo-text {
    font-size: 20px;
    color: #0066cc;
}

.university-name {
    color: #333;
    font-size: 14px;
    font-weight: 500;
}

/* 二维码区域 */
.qr-code-section {
    margin-top: 15px;
}

.qr-code-container {
    display: inline-block;
    text-align: center;
}

.qr-code {
    display: block;
    margin: 0 auto 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    width: 100px;
    height: 100px;
    object-fit: contain;
}

.qr-code-text {
    font-size: 11px;
    color: #999;
    margin: 0;
}

/* 弹窗样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #fff;
    border-radius: 8px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: modalShow 0.3s ease;
}

@keyframes modalShow {
    from {
        opacity: 0;
        transform: scale(0.7);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 20px 0;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #003366;
}

.modal-close {
    font-size: 24px;
    cursor: pointer;
    color: #6c757d;
    line-height: 1;
}

.modal-close:hover {
    color: #495057;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 0 20px 20px;
    text-align: right;
}

.modal-btn {
    background: #0066cc;
    color: #fff;
    border: none;
    padding: 10px 25px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.modal-btn:hover {
    background: #0052a3;
}

/* 响应式设计 - 平板设备 */
@media (max-width: 768px) {
    body {
        padding-bottom: 60px;
    }
    
    .form-container {
        margin: 10px;
        border-radius: 8px;
        box-shadow: none;
        overflow: visible;
    }
    
    .form-body {
        padding: 30px 20px 80px 20px;
        overflow: visible;
    }
    
    .header-title h1 {
        font-size: 24px;
    }
    
    .header-subtitle {
        font-size: 14px;
    }
    
    .form-row {
        flex-direction: column;
        margin: 0;
    }
    
    .form-group,
    .form-group.col-6 {
        margin: 0 0 20px;
        min-width: auto;
        flex: 1;
    }
    
    .radio-group {
        flex-direction: column;
        gap: 15px;
    }
    
    .section-title {
        font-size: 18px;
    }
    
    .submit-btn {
        width: 100%;
        min-width: auto;
        padding: 16px 20px;
    }
    
    .form-submit {
        margin: 40px 0 60px 0;
        padding: 20px;
        background: #fff;
        border-radius: 8px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }
    
    .city-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .detail-item {
        flex-direction: column;
        gap: 4px;
    }
    
    .detail-item .label {
        min-width: auto;
    }
}

/* 响应式设计 - 手机设备 */
@media (max-width: 480px) {
    body {
        background-attachment: scroll;
        padding-bottom: 80px;
    }
    
    .form-container {
        margin: 0;
        border-radius: 0;
        min-height: auto;
        overflow: visible;
    }
    
    .form-header {
        padding: 30px 15px;
    }
    
    .header-title h1 {
        font-size: 20px;
    }
    
    .header-subtitle {
        font-size: 13px;
    }
    
    .form-body {
        padding: 20px 15px 100px 15px;
        overflow: visible;
    }
    
    .form-submit {
        position: relative;
        z-index: 10;
        margin: 30px 0 50px 0;
        padding: 20px;
        background: #fff;
        border-radius: 8px;
        box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    }
    
    .form-section {
        margin-bottom: 30px;
    }
    
    .section-title {
        font-size: 16px;
        margin-bottom: 20px;
    }
    
    input[type="text"],
    input[type="tel"],
    input[type="email"],
    select,
    textarea {
        font-size: 16px; /* 防止iOS缩放 */
        padding: 14px 16px;
    }
    
    .checkbox-label {
        padding: 12px;
    }
    
    .city-label {
        padding: 15px;
    }
    
    .city-info {
        margin-left: 10px;
    }
    
    .form-footer {
        font-size: 11px;
        padding: 20px 15px;
    }
    
    .modal-content {
        margin: 20px;
    }
    
    .cities-selection {
        gap: 15px;
    }
}

/* 加载状态样式 */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.btn-loading {
    display: inline-flex;
    align-items: center;
}

.btn-loading::after {
    content: '';
    width: 16px;
    height: 16px;
    margin-left: 10px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 表单验证效果 */
.field-error {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1) !important;
}

.field-success {
    border-color: #28a745 !important;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1) !important;
}

/* 焦点可见性改善 */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
}

/* 打印样式 */
@media print {
    .modal {
        display: none !important;
    }
    
    .form-container {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .submit-btn,
    .form-footer {
        display: none;
    }
    
    .form-header {
        background: #fff !important;
        color: #000 !important;
        -webkit-print-color-adjust: exact;
    }
}

/* 高对比度和可访问性 */
@media (prefers-contrast: high) {
    .checkbox-label,
    .city-option {
        border-color: #000;
    }
    
    .submit-btn {
        background: #000 !important;
    }
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-section {
    animation: fadeInUp 0.6s ease-out;
}

.form-section:nth-child(2) { animation-delay: 0.1s; }
.form-section:nth-child(3) { animation-delay: 0.2s; }
.form-section:nth-child(4) { animation-delay: 0.3s; }
.form-section:nth-child(5) { animation-delay: 0.4s; }