/* ========================================
   MODERN LOGIN & REGISTRATION FORMS
   ======================================== */

/* Grundläggande layout */
.modern-login-wrapper {
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 20px;
}

/* Header sektion */
.login-header {
    background: linear-gradient(135deg, #162a49 0%, #0f1216 100%);
    color: white;
    padding: 60px 0;
    margin-bottom: 50px;
    border-radius: 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.login-header::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(50%, -50%);
}

.login-header-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.login-main-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 15px;
    line-height: 1.2;
    font-family: 'CustomHeadingFont', sans-serif;
}

.login-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    line-height: 1.5;
    margin: 0;
}

/* Formulärcontainer */
.login-forms-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 50px;
}

.login-forms-container.single-form {
    grid-template-columns: 1fr;
    max-width: 500px;
    margin: 0 auto 50px;
}

/* Formulärkort */
.form-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid #f0f0f0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.form-card:hover {
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.register-card {
    border-top: 4px solid var(--accentColor2, #e4002b);
}

/* Formulärhuvud */
.form-header {
    padding: 40px 40px 30px;
    text-align: center;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.form-icon {
    width: 60px;
    height: 60px;
    background: var(--accentColor, #162a49);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: white;
}

.register-icon {
    background: var(--accentColor2, #e4002b);
}

.form-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
    font-family: 'CustomHeadingFont', sans-serif;
}

.form-description {
    color: #666;
    font-size: 1rem;
    line-height: 1.5;
    margin: 0;
}

/* Fördelar sektion */
.benefits-section {
    padding: 30px 40px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #e9ecef;
}

.benefits-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 15px;
    font-family: 'CustomHeadingFont', sans-serif;
}

.benefits-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: #555;
}

.benefit-item svg {
    color: var(--accentColor2, #e4002b);
    flex-shrink: 0;
}

.benefit-item:last-child {
    margin-bottom: 0;
}

/* Formulär styling */
.modern-form {
    padding: 40px;
}

/* Specifik styling för namn-raden */
.woocommerce-form-register .form-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 15px !important;
    margin-bottom: 25px !important;
}

.woocommerce-form-register .form-group-half {
    margin-bottom: 0 !important;
}

/* Ta bort eventuella pseudo-element som skapar tomma ytor */
.form-row::before,
.form-row::after,
.form-group-half::before,
.form-group-half::after {
    display: none !important;
    content: none !important;
}

/* Säkerställ att inga float eller clearfix påverkar */
.form-row,
.form-group-half {
    float: none !important;
    clear: none !important;
}

/* Ta bort eventuella WooCommerce standard-marginaler */
.woocommerce-form-register .form-row .form-group-half {
    margin: 0 !important;
    padding: 0 !important;
}

/* Ta bort eventuella bakgrunder och element som kan skapa tomma ytor */
.form-row *,
.form-group-half * {
    background: transparent !important;
}

.form-row .form-group-half {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* Specifik fix för eventuella WooCommerce element */
.woocommerce-form-register .form-row::before,
.woocommerce-form-register .form-row::after,
.woocommerce-form-register .form-group-half::before,
.woocommerce-form-register .form-group-half::after {
    display: none !important;
    content: none !important;
    background: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* Ta bort eventuella absolut positionerade element - ENDAST för login/register formulär */
.woocommerce-form-login .form-row > *:not(.form-group-half),
.woocommerce-form-register .form-row > *:not(.form-group-half),
.login .form-row > *:not(.form-group-half) {
    display: none !important;
}

.form-group {
    margin-bottom: 25px;
}

/* Formulärrad för två kolumner - Aggressiv reset - ENDAST för login/register formulär */
.woocommerce-form-login .form-row,
.woocommerce-form-register .form-row,
.login .form-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 15px !important;
    margin-bottom: 25px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    position: relative !important;
    overflow: visible !important;
}

.woocommerce-form-login .form-group-half,
.woocommerce-form-register .form-group-half,
.login .form-group-half {
    margin-bottom: 0 !important;
    margin-top: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Säkerställ att form-row fungerar */
.modern-form .form-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 15px !important;
    width: 100% !important;
}

.modern-form .form-group-half {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.form-label .required {
    color: var(--accentColor2, #e4002b);
    margin-left: 3px;
}

.form-label .optional {
    color: #999;
    font-weight: 400;
    font-size: 0.85rem;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    z-index: 2;
}

.form-input {
    width: 100%;
    padding: 15px 15px 15px 50px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
    box-sizing: border-box;
}

.form-input:focus {
    border-color: var(--accentColor2, #e4002b);
    box-shadow: 0 0 0 3px rgba(228, 0, 43, 0.1);
    outline: none;
}

.form-input:focus + .input-icon {
    color: var(--accentColor2, #e4002b);
}

.form-input::placeholder {
    color: #999;
}

/* Textarea styling */
.textarea-wrapper {
    position: relative;
}

.textarea-icon {
    position: absolute;
    left: 15px;
    top: 15px;
    color: #999;
    z-index: 2;
}

.form-textarea {
    width: 100%;
    padding: 15px 15px 15px 50px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
    box-sizing: border-box;
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
    line-height: 1.5;
}

.form-textarea:focus {
    border-color: var(--accentColor2, #e4002b);
    box-shadow: 0 0 0 3px rgba(228, 0, 43, 0.1);
    outline: none;
}

.form-textarea:focus + .textarea-icon {
    color: var(--accentColor2, #e4002b);
}

.form-textarea::placeholder {
    color: #999;
}

/* Hjälptext */
.field-help {
    display: block;
    margin-top: 8px;
    font-size: 0.85rem;
    color: #666;
    line-height: 1.4;
}

/* Formuläralternativ */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-input {
    width: 18px;
    height: 18px;
    accent-color: var(--accentColor2, #e4002b);
}

.checkbox-label {
    font-size: 0.9rem;
    color: #666;
}

.forgot-password {
    color: var(--accentColor2, #e4002b);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.forgot-password:hover {
    color: var(--accentColor, #162a49);
    text-decoration: underline;
}

/* Submit knappar */
.form-submit-btn {
    width: 100%;
    background: var(--accentColor2, #e4002b);
    color: white;
    border: none;
    padding: 18px 25px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: 'CustomContentFont', sans-serif;
}

.form-submit-btn:hover {
    background: var(--accentColor, #162a49);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(228, 0, 43, 0.3);
}

.register-btn {
    background: linear-gradient(135deg, var(--accentColor2, #e4002b) 0%, #c8002a 100%);
}

.register-btn:hover {
    background: linear-gradient(135deg, var(--accentColor, #162a49) 0%, #0f1216 100%);
}

/* Lösenordsinformation */
.password-info {
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
}

.info-icon {
    color: #0066cc;
    flex-shrink: 0;
    margin-top: 2px;
}

.password-info p {
    margin: 0;
    color: #0066cc;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Avtalsinformation */
.contract-info {
    margin-bottom: 25px;
}

.info-box {
    background: linear-gradient(135deg, #e8f5e8 0%, #d4f1d4 100%);
    border: 1px solid #b3e5b3;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.info-box .info-icon {
    color: #28a745;
    flex-shrink: 0;
    margin-top: 2px;
}

.info-content h4 {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #155724;
    font-family: 'CustomHeadingFont', sans-serif;
}

.info-content p {
    margin: 0;
    color: #155724;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Kontaktsektion */
.contact-section {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
}

.contact-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
    font-family: 'CustomHeadingFont', sans-serif;
}

.contact-description {
    color: #666;
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 25px;
}

.contact-methods {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.contact-method {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    color: var(--accentColor2, #e4002b);
    text-decoration: none;
    padding: 12px 20px;
    border-radius: 25px;
    border: 2px solid var(--accentColor2, #e4002b);
    font-weight: 600;
    transition: all 0.3s ease;
}

.contact-method:hover {
    background: var(--accentColor2, #e4002b);
    color: white;
    transform: translateY(-2px);
}

/* ========================================
   RESPONSIV DESIGN
   ======================================== */

/* Tablet */
@media (max-width: 992px) {
    .modern-login-wrapper {
        padding: 0 15px;
        margin: 30px auto;
    }

    .login-main-title {
        font-size: 2.5rem;
    }

    .login-subtitle {
        font-size: 1.1rem;
    }

    .login-forms-container {
        gap: 30px;
    }

    .form-header {
        padding: 30px 30px 25px;
    }

    .modern-form {
        padding: 30px;
    }

    .benefits-section {
        padding: 25px 30px;
    }

    .contact-section {
        padding: 30px;
    }
}

/* Mobil */
@media (max-width: 768px) {
    .modern-login-wrapper {
        padding: 0 10px;
        margin: 20px auto;
    }

    .login-header {
        padding: 40px 0;
        margin-bottom: 30px;
        border-radius: 15px;
    }

    .login-main-title {
        font-size: 2rem;
    }

    .login-subtitle {
        font-size: 1rem;
    }

    .login-forms-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .login-forms-container.single-form {
        max-width: none;
    }

    .form-card {
        border-radius: 15px;
    }

    .form-header {
        padding: 25px 20px 20px;
    }

    .form-icon {
        width: 50px;
        height: 50px;
        margin-bottom: 15px;
    }

    .form-title {
        font-size: 1.5rem;
    }

    .form-description {
        font-size: 0.9rem;
    }

    .benefits-section {
        padding: 20px;
    }

    .modern-form {
        padding: 25px 20px;
    }

    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .form-group-half {
        margin-bottom: 20px;
    }

    .contact-section {
        padding: 25px 20px;
        border-radius: 15px;
    }

    .contact-methods {
        flex-direction: column;
        align-items: center;
    }

    .contact-method {
        width: 100%;
        max-width: 250px;
        justify-content: center;
    }
}

/* Extra små skärmar */
@media (max-width: 480px) {
    .modern-login-wrapper {
        margin: 15px auto;
    }

    .login-header {
        padding: 30px 0;
        margin-bottom: 25px;
    }

    .login-main-title {
        font-size: 1.8rem;
    }

    .form-header {
        padding: 20px 15px 15px;
    }

    .form-icon {
        width: 45px;
        height: 45px;
    }

    .form-title {
        font-size: 1.3rem;
    }

    .benefits-section {
        padding: 15px;
    }

    .modern-form {
        padding: 20px 15px;
    }

    .form-input {
        padding: 12px 12px 12px 45px;
        font-size: 0.95rem;
    }

    .input-icon {
        left: 12px;
    }

    .textarea-icon {
        left: 12px;
    }

    .form-textarea {
        padding: 12px 12px 12px 45px;
        font-size: 0.95rem;
    }

    .form-submit-btn {
        padding: 15px 20px;
        font-size: 1rem;
    }

    .contact-section {
        padding: 20px 15px;
    }

    .contact-title {
        font-size: 1.3rem;
    }

    .contact-description {
        font-size: 0.9rem;
    }
}

/* Förbättra formulärfält på touch-enheter */
@media (hover: none) and (pointer: coarse) {
    .form-input {
        font-size: 16px; /* Förhindra zoom på iOS */
    }

    .form-submit-btn {
        min-height: 48px; /* Bättre touch-target */
    }

    .checkbox-input {
        min-width: 20px;
        min-height: 20px;
    }
}
