/* ========================================
   Auth Premium Styles - Login & Register
   ======================================== */

/* ===== Auth Hero Section ===== */
#auth-hero-section {
    position: relative;
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8rem 2rem 4rem;
    overflow: hidden;
}

.auth-hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #4F46E5 0%, #8B5CF6 100%);
    z-index: 0;
}

.auth-hero-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
}

.gradient-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.3) 100%);
}

.auth-hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.auth-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 50px;
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.auth-hero-badge.success {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.5);
}

.auth-hero-badge i {
    font-size: 1.1rem;
}

.auth-hero-title {
    font-size: 3.5rem;
    font-weight: 900;
    color: white;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.auth-hero-title .highlight-text {
    background: linear-gradient(135deg, #fff 0%, #e0e7ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-hero-subtitle {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.8;
    max-width: 600px;
    margin: 0 auto;
}

/* ===== Auth Form Section ===== */
#auth-form-section {
    padding: 4rem 2rem;
    background: #f8f9fc;
    margin-top: -2rem;
    position: relative;
    z-index: 2;
}

#auth-form-section .container {
    max-width: 1600px;
}

.auth-form-container {
    max-width: 550px;
    margin: 0 auto;
}

.auth-form-container.register {
    max-width: 750px;
}

/* ===== Auth Messages ===== */
.auth-messages {
    margin-bottom: 2rem;
}

.auth-message {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
}

.auth-message.error {
    background: #FEF2F2;
    border-left: 4px solid #EF4444;
    color: #991B1B;
}

.auth-message i {
    font-size: 1.25rem;
}

/* ===== Auth Form Card ===== */
.auth-form-card {
    background: white;
    border-radius: 24px;
    padding: 3rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.auth-form {
    width: 100%;
}

.auth-form-fields {
    margin-bottom: 2rem;
}

/* Django Form Fields Styling */
.auth-form-fields p {
    margin-bottom: 1.5rem;
}

.auth-form-fields label {
    display: block;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.auth-form-fields input[type="text"],
.auth-form-fields input[type="password"],
.auth-form-fields input[type="email"] {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: 'Noto Sans KR', sans-serif;
}

.auth-form-fields input:focus {
    outline: none;
    border-color: #4F46E5;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.auth-form-fields .errorlist {
    margin: 0.5rem 0 0 0;
    padding: 0;
    list-style: none;
    color: #EF4444;
    font-size: 0.875rem;
}

/* ===== Submit Button ===== */
.auth-submit-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #4F46E5 0%, #8B5CF6 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Noto Sans KR', sans-serif;
}

.auth-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(79, 70, 229, 0.3);
}

.auth-submit-btn i {
    font-size: 1.2rem;
}

.auth-submit-btn.register-btn {
    margin-top: 2rem;
}

/* ===== Divider ===== */
.auth-divider {
    position: relative;
    text-align: center;
    margin: 2rem 0;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e5e7eb;
}

.auth-divider span {
    position: relative;
    display: inline-block;
    padding: 0 1rem;
    background: white;
    color: #6b7280;
    font-size: 0.9rem;
    font-weight: 500;
}

/* ===== Kakao Login Button ===== */
.kakao-login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 1rem 2rem;
    background: #FEE500;
    color: #000000;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    font-family: 'Noto Sans KR', sans-serif;
}

.kakao-login-btn:hover {
    background: #FDD835;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(254, 229, 0, 0.3);
}

.kakao-login-btn img {
    height: 1.2rem;
    vertical-align: middle;
}

/* ===== Auth Links ===== */
.auth-links {
    margin-top: 2rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.auth-link {
    color: #6b7280;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.auth-link:hover {
    color: #4F46E5;
}

.auth-separator {
    color: #d1d5db;
}

/* ===== Register Specific Styles ===== */

/* Form Selection */
.form-selection {
    text-align: center;
    margin-bottom: 2rem;
}

.form-selection button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #4F46E5 0%, #8B5CF6 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-selection button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(79, 70, 229, 0.3);
}

/* Info Notice */
.register-info-notice {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.notice-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    color: #3730A3;
    font-size: 0.95rem;
    line-height: 1.6;
}

.notice-item:not(:last-child) {
    margin-bottom: 0.75rem;
}

.notice-item i {
    font-size: 1.1rem;
    margin-top: 0.15rem;
    flex-shrink: 0;
}

/* Register Sections */
.register-section {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e5e7eb;
}

.register-section:last-of-type {
    border-bottom: none;
}

.register-section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #4F46E5;
}

.register-section-title i {
    color: #4F46E5;
}

/* Register Form Group */
.register-form-group {
    margin-bottom: 1.5rem;
}

.register-form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.register-form-group label i {
    color: #6b7280;
    font-size: 0.9rem;
}

.register-form-group input[type="text"],
.register-form-group input[type="password"],
.register-form-group input[type="email"],
.register-form-group select {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: 'Noto Sans KR', sans-serif;
}

.register-form-group input:focus,
.register-form-group select:focus {
    outline: none;
    border-color: #4F46E5;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.field-hint {
    display: block;
    margin-top: 0.5rem;
    color: #6b7280;
    font-size: 0.85rem;
}

/* Register Error */
.register-error {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    color: #EF4444;
    font-size: 0.875rem;
}

.register-error i {
    font-size: 0.9rem;
}

/* Password Match Messages */
.password-match,
.password-error {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
}

.password-match {
    background: #ECFDF5;
    color: #059669;
    border: 1px solid #A7F3D0;
}

.password-error {
    background: #FEF2F2;
    color: #DC2626;
    border: 1px solid #FECACA;
}

/* ===== Register Success Card ===== */
.register-success-card {
    background: white;
    border-radius: 24px;
    padding: 3rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.success-icon-container {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.success-icon-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10B981 0%, #34D399 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: successPulse 2s ease-in-out infinite;
}

.success-icon-circle i {
    font-size: 4rem;
    color: white;
}

@keyframes successPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }
    50% {
        box-shadow: 0 0 0 20px rgba(16, 185, 129, 0);
    }
}

.success-content {
    margin-bottom: 3rem;
}

.success-content h2 {
    font-size: 2rem;
    font-weight: 800;
    color: #1f2937;
    margin-bottom: 1rem;
}

.success-content p {
    font-size: 1.1rem;
    color: #6b7280;
}

/* Success Info Grid */
.success-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.success-info-card {
    background: linear-gradient(135deg, #F9FAFB 0%, #F3F4F6 100%);
    padding: 1.5rem;
    border-radius: 16px;
    border: 2px solid #e5e7eb;
    transition: all 0.3s ease;
}

.success-info-card:hover {
    border-color: #4F46E5;
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(79, 70, 229, 0.15);
}

.success-info-card .info-icon {
    width: 50px;
    height: 50px;
    margin: 0 auto 1rem;
    border-radius: 12px;
    background: linear-gradient(135deg, #4F46E5 0%, #8B5CF6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.success-info-card .info-icon i {
    font-size: 1.5rem;
    color: white;
}

.success-info-card h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.success-info-card p {
    font-size: 0.9rem;
    color: #6b7280;
    line-height: 1.6;
}

/* Success Actions */
.success-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.success-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    font-family: 'Noto Sans KR', sans-serif;
}

.success-btn.primary {
    background: linear-gradient(135deg, #4F46E5 0%, #8B5CF6 100%);
    color: white;
}

.success-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(79, 70, 229, 0.3);
}

.success-btn.secondary {
    background: white;
    color: #4F46E5;
    border: 2px solid #4F46E5;
}

.success-btn.secondary:hover {
    background: #4F46E5;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(79, 70, 229, 0.3);
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .auth-hero-title {
        font-size: 2.5rem;
    }

    .auth-hero-subtitle {
        font-size: 1.1rem;
    }

    #auth-hero-section {
        padding: 6rem 1.5rem 3rem;
        min-height: 40vh;
    }

    #auth-form-section {
        padding: 3rem 1.5rem;
    }

    .auth-form-card {
        padding: 2rem 1.5rem;
    }

    .register-success-card {
        padding: 2rem 1.5rem;
    }

    .success-icon-circle {
        width: 100px;
        height: 100px;
    }

    .success-icon-circle i {
        font-size: 3rem;
    }

    .success-content h2 {
        font-size: 1.5rem;
    }

    .success-info-grid {
        grid-template-columns: 1fr;
    }

    .success-actions {
        flex-direction: column;
    }

    .success-btn {
        width: 100%;
    }

    .auth-hero-badge {
        font-size: 0.85rem;
        padding: 0.6rem 1.2rem;
    }
}

@media (max-width: 480px) {
    .auth-hero-title {
        font-size: 2rem;
    }

    .auth-hero-subtitle {
        font-size: 1rem;
    }

    .auth-form-card {
        padding: 1.5rem 1rem;
    }

    .register-success-card {
        padding: 1.5rem 1rem;
    }

    .register-section-title {
        font-size: 1.1rem;
    }

    .success-content h2 {
        font-size: 1.25rem;
    }
}

/* ===== TOS (Terms of Service) Styles ===== */

/* TOS Container */
.auth-form-container.tos {
    max-width: 1400px;
}

.auth-form-container.tos .auth-form-card {
    padding: 3rem 2.5rem;
}

/* TOS Step Header */
.tos-step-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #e5e7eb;
}

.tos-step-number {
    width: 70px;
    height: 70px;
    border-radius: 16px;
    background: linear-gradient(135deg, #4F46E5 0%, #8B5CF6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tos-step-number i {
    font-size: 2rem;
    color: white;
}

.tos-step-info h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.tos-step-info p {
    font-size: 1rem;
    color: #6b7280;
    margin: 0;
}

/* TOS Info Form */
.tos-info-form {
    width: 100%;
}

.tos-form-group {
    margin-bottom: 1.5rem;
}

.tos-form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.tos-form-group label i {
    color: #6b7280;
    font-size: 0.9rem;
}

.tos-form-group input[type="text"] {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: 'Noto Sans KR', sans-serif;
}

.tos-form-group input:focus {
    outline: none;
    border-color: #4F46E5;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

/* TOS Canvas Step */
.tos-canvas-step {
    width: 100%;
}

.tos-canvas-container {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    width: 100%;
}

/* Canvas Wrapper */
.canvas-wrapper {
    flex: 1;
    background: #f9fafb;
    border-radius: 16px;
    padding: 1.5rem;
    border: 2px solid #e5e7eb;
    display: flex;
    justify-content: center;
    min-width: 0;
    overflow: auto;
}

#pdf-canvas {
    border: 2px solid #d1d5db;
    border-radius: 8px;
    cursor: crosshair;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-width: 100%;
    height: auto;
}

/* TOS Signature Controls */
.tos-signature-controls {
    flex: 0 0 350px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-width: 0;
}

.tos-reset-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: white;
    color: #6b7280;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Noto Sans KR', sans-serif;
}

.tos-reset-btn:hover {
    border-color: #EF4444;
    color: #EF4444;
    background: #FEF2F2;
}

.tos-reset-btn i {
    font-size: 1rem;
}

/* TOS Checkbox Group */
.tos-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.tos-checkbox-item {
    position: relative;
}

.tos-checkbox-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.tos-checkbox-item label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #374151;
}

.tos-checkbox-item label i {
    font-size: 1.25rem;
    color: #d1d5db;
    flex-shrink: 0;
    margin-top: 0.1rem;
    transition: all 0.3s ease;
}

.tos-checkbox-item input[type="checkbox"]:checked + label {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border-color: #4F46E5;
}

.tos-checkbox-item input[type="checkbox"]:checked + label i {
    color: #4F46E5;
}

.tos-checkbox-item label:hover {
    border-color: #4F46E5;
    background: #f3f4f6;
}

.tos-checkbox-item label span {
    flex: 1;
}

/* TOS Submit Button */
.auth-submit-btn.tos-submit {
    margin-top: 0;
}

#tosForm {
    width: 100%;
}

/* TOS Responsive Design */
@media (max-width: 1400px) {
    .auth-form-container.tos {
        max-width: 95%;
    }

    .tos-signature-controls {
        flex: 0 0 300px;
    }
}

@media (max-width: 1024px) {
    .tos-canvas-container {
        flex-direction: column;
    }

    .tos-signature-controls {
        flex: 1;
        width: 100%;
    }

    .canvas-wrapper {
        width: 100%;
        overflow-x: auto;
    }
}

@media (max-width: 768px) {
    .auth-form-container.tos .auth-form-card {
        padding: 2rem 1.5rem;
    }

    .tos-step-header {
        gap: 1rem;
    }

    .tos-step-number {
        width: 60px;
        height: 60px;
    }

    .tos-step-number i {
        font-size: 1.75rem;
    }

    .tos-step-info h3 {
        font-size: 1.25rem;
    }

    .tos-step-info p {
        font-size: 0.9rem;
    }

    .canvas-wrapper {
        padding: 1rem;
    }

    #pdf-canvas {
        max-width: 100%;
        height: auto;
    }

    .tos-checkbox-item label {
        font-size: 0.85rem;
        padding: 0.875rem;
    }
}

@media (max-width: 480px) {
    .auth-form-container.tos .auth-form-card {
        padding: 1.5rem 1rem;
    }

    .tos-step-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .tos-step-number {
        width: 50px;
        height: 50px;
    }

    .tos-step-number i {
        font-size: 1.5rem;
    }

    .tos-step-info h3 {
        font-size: 1.1rem;
    }

    .canvas-wrapper {
        padding: 0.75rem;
    }

    .tos-checkbox-item label {
        font-size: 0.8rem;
        gap: 0.5rem;
    }

    .tos-checkbox-item label i {
        font-size: 1.1rem;
    }
}
