:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #8b5cf6;
    --success-color: #81c784;
    --warning-color: #ffb74d;
    --light-gray: #f8f9fa;
    --medium-gray: #e9ecef;
    --text-color: #2d3748;
    --text-light: #718096;
    --border-color: #e2e8f0;
    --shadow-light: rgba(0, 0, 0, 0.08);
    --shadow-medium: rgba(0, 0, 0, 0.12);
    --gradient-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --card-bg: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--gradient-bg);
    min-height: 100vh;
    color: var(--text-color);
    line-height: 1.7;
    padding: 20px 0;
}

.register-container {
    background: var(--card-bg);
    padding: 50px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

.header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

.header::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
    opacity: 0.6;
}

.header h1 {
    color: var(--primary-color);
    font-size: 28px;
    margin-bottom: 10px;
    font-weight: 700;
}

.header p {
    color: var(--text-light);
    font-size: 16px;
    font-weight: 400;
}

.form-row {
    display: flex;
    gap: 24px;
    margin-bottom: 25px;
}

.form-group {
    flex: 1;
    margin-bottom: 25px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-color);
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.5px;
}

.required {
    color: var(--primary-color);
    margin-left: 4px;
    font-weight: 700;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.form-group input:hover,
.form-group select:hover {
    border-color: var(--secondary-color);
    box-shadow: 0 2px 8px var(--shadow-light);
}

.form-group.error input,
.form-group.error select {
    border-color: #dc3545;
    background: rgba(220, 53, 69, 0.03);
}

.error-message {
    color: #dc3545;
    font-size: 13px;
    margin-top: 6px;
    font-weight: 500;
}

.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    padding-right: 55px;
}

.toggle-btn {
    position: absolute;
    right: 16px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
    z-index: 10;
}

.toggle-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.password-strength {
    margin-top: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    display: none;
    font-weight: 500;
    border-left: 4px solid;
}

.strength-weak {
    background: rgba(220, 53, 69, 0.08);
    color: #c53030;
    border-left-color: #dc3545;
}

.strength-medium {
    background: rgba(255, 183, 77, 0.1);
    color: #d69e2e;
    border-left-color: var(--warning-color);
}

.strength-strong {
    background: rgba(129, 199, 132, 0.1);
    color: #38a169;
    border-left-color: var(--success-color);
}

.address-type-selection {
    background: rgba(248, 250, 252, 0.8);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 25px;
}

.address-type-selection label:first-child {
    display: block;
    margin-bottom: 15px;
    font-weight: 600;
    color: var(--text-color);
    font-size: 15px;
}

.radio-group {
    display: flex;
    gap: 30px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border-radius: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.radio-option:hover {
    background: rgba(99, 102, 241, 0.05);
}

.radio-option input[type="radio"] {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--primary-color);
}

.radio-option label {
    margin: 0;
    font-weight: 500;
    cursor: pointer;
    font-size: 15px;
}

.submit-btn {
    width: 100%;
    padding: 18px 0;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 35px 0 25px 0;
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.3);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

.submit-btn:disabled {
    background: linear-gradient(135deg, #cbd5e0, #a0aec0);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.message {
    padding: 18px 24px;
    border-radius: 14px;
    margin-bottom: 30px;
    font-weight: 500;
    border-left: 4px solid;
}

.message.success {
    background: rgba(129, 199, 132, 0.1);
    color: #2f855a;
    border-left-color: var(--success-color);
}

.message.error {
    background: rgba(220, 53, 69, 0.08);
    color: #c53030;
    border-left-color: #dc3545;
}

.duplicate-email-error {
    background: rgba(220, 53, 69, 0.05);
    border: 2px solid rgba(220, 53, 69, 0.2);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 30px;
}

.duplicate-email-error h3 {
    color: #dc3545;
    margin-bottom: 18px;
    font-size: 18px;
}

.error-actions { margin-top: 20px; }

.error-actions p {
    margin: 15px 0 10px 0;
    font-weight: 600;
    color: var(--text-color);
    font-size: 15px;
}

.action-link {
    display: inline-block;
    margin: 6px 12px 6px 0;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.action-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.3);
}

.action-link.secondary {
    background: linear-gradient(135deg, var(--medium-gray), #cbd5e0);
    color: var(--text-color);
}

.login-link {
    text-align: center;
    margin-top: 25px;
    padding: 20px;
    background: rgba(248, 250, 252, 0.6);
    border-radius: 14px;
    border: 1px solid var(--border-color);
}

.login-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    padding: 8px 16px;
    border-radius: 8px;
    display: inline-block;
}

.login-link a:hover {
    background: rgba(99, 102, 241, 0.1);
}

.requirements {
    background: rgba(238, 242, 255, 0.8);
    border: 2px solid rgba(99, 102, 241, 0.2);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 35px;
}

.requirements h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 18px;
}

.requirements ul {
    margin-left: 25px;
    color: #4338ca;
}

.requirements li {
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.6;
}

.email-info {
    background: rgba(129, 199, 132, 0.08);
    border-radius: 16px;
    padding: 25px;
    margin: 25px 0;
    border: 2px solid rgba(129, 199, 132, 0.2);
}

.email-info h3 {
    color: #38a169;
    margin-bottom: 12px;
    font-size: 16px;
}

.email-address {
    font-family: 'Courier New', monospace;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.7);
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.next-steps,
.important-notice,
.welcome-message {
    background: rgba(248, 250, 252, 0.8);
    border-radius: 16px;
    padding: 25px;
    margin: 25px 0;
    border: 2px solid var(--border-color);
}

.next-steps h3,
.important-notice h3,
.welcome-message h3 {
    color: var(--text-color);
    margin-bottom: 15px;
    font-size: 18px;
}

.next-steps ol,
.important-notice ul,
.welcome-message ul {
    margin-left: 25px;
    color: var(--text-color);
}

.next-steps li,
.important-notice li,
.welcome-message li {
    margin-bottom: 10px;
    line-height: 1.6;
}

.user-info {
    background: rgba(99, 102, 241, 0.05);
    border-radius: 16px;
    padding: 25px;
    margin: 25px 0;
    border: 2px solid rgba(99, 102, 241, 0.15);
}

.user-details p {
    margin-bottom: 8px;
    line-height: 1.6;
}

.login-btn {
    display: inline-block;
    padding: 16px 32px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 18px;
    margin: 20px 0;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.3);
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

.navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding: 20px;
    background: rgba(248, 250, 252, 0.6);
    border-radius: 14px;
    border: 1px solid var(--border-color);
}

.navigation a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.navigation a:hover {
    background: rgba(99, 102, 241, 0.1);
}

.help-section {
    margin-top: 30px;
}

.help-section h3 {
    color: var(--text-color);
    margin-bottom: 15px;
    font-size: 18px;
}

details {
    background: rgba(248, 250, 252, 0.8);
    border-radius: 12px;
    margin-bottom: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

summary {
    padding: 16px 20px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-color);
    transition: all 0.3s ease;
}

summary:hover {
    background: rgba(99, 102, 241, 0.05);
}

details[open] summary {
    background: rgba(99, 102, 241, 0.08);
    border-bottom: 1px solid var(--border-color);
}

details p,
details ul {
    padding: 16px 20px;
    color: var(--text-color);
    line-height: 1.6;
}

.footer {
    text-align: center;
    margin-top: 30px;
    color: var(--text-light);
    font-size: 13px;
}

.label-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.label-row .form-label {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .register-container {
        padding: 30px 20px;
        margin: 0 10px;
        border-radius: 16px;
    }
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    .radio-group {
        flex-direction: column;
        gap: 15px;
    }
    .navigation {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    .header h1 {
        font-size: 24px;
    }
    .submit-btn {
        font-size: 16px;
        padding: 16px 0;
    }
}
